[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 12 commits - cui/uiconfig dbaccess/source emfio/qa extras/source filter/source include/oox include/xmloff oox/qa oox/source reportdesign/source sc/source sfx2/source solenv/flatpak-manifest.in sw/inc sw/qa sw/source tools/source vcl/unx xmloff/source
Bartosz Kosiorek (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 21 11:32:39 UTC 2021
cui/uiconfig/ui/textanimtabpage.ui | 15
dbaccess/source/filter/xml/xmlExport.cxx | 6
emfio/qa/cppunit/emf/EmfImportTest.cxx | 15
emfio/qa/cppunit/emf/data/TestArcInsideWronglyDefinedRectangle.emf |binary
extras/source/autocorr/lang/ko/DocumentList.xml | 1
filter/source/xslt/odf2xhtml/export/xhtml/body.xsl | 128 ++---
include/oox/drawingml/shape.hxx | 4
include/xmloff/xmlexppr.hxx | 3
include/xmloff/xmluconv.hxx | 9
oox/qa/unit/data/tdf141463_GroupTransform.pptx |binary
oox/qa/unit/shape.cxx | 55 ++
oox/source/drawingml/shape.cxx | 234 ++++++----
reportdesign/source/filter/xml/xmlExport.cxx | 8
sc/source/filter/xml/xmlexprt.cxx | 20
sfx2/source/doc/objstor.cxx | 13
solenv/flatpak-manifest.in | 6
sw/inc/unosett.hxx | 5
sw/qa/extras/htmlexport/xhtmlexport.cxx | 16
sw/qa/extras/odfexport/data/tdf118637.odt |binary
sw/qa/extras/unowriter/unowriter.cxx | 33 +
sw/source/core/unocore/unosett.cxx | 22
sw/source/filter/xml/xmliteme.cxx | 3
sw/source/filter/xml/xmlitemi.cxx | 3
sw/source/uibase/config/StoredChapterNumbering.cxx | 2
sw/source/uibase/shells/tabsh.cxx | 8
tools/source/generic/poly.cxx | 9
vcl/unx/gtk3/gtk3gtkinst.cxx | 3
xmloff/source/chart/PropertyMaps.cxx | 6
xmloff/source/chart/SchXMLExport.cxx | 101 ++--
xmloff/source/chart/SchXMLTools.cxx | 3
xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx | 6
xmloff/source/core/xmlexp.cxx | 46 +
xmloff/source/core/xmlimp.cxx | 3
xmloff/source/core/xmluconv.cxx | 21
xmloff/source/draw/sdxmlexp.cxx | 2
xmloff/source/draw/shapeexport.cxx | 4
xmloff/source/forms/layerexport.cxx | 2
xmloff/source/style/XMLPageExport.cxx | 6
xmloff/source/style/chrlohdl.cxx | 10
xmloff/source/style/styleexp.cxx | 4
xmloff/source/style/xmlexppr.cxx | 9
xmloff/source/table/XMLTableExport.cxx | 6
xmloff/source/text/txtparae.cxx | 8
43 files changed, 559 insertions(+), 299 deletions(-)
New commits:
commit 3c1121fad94e82b2d4e047dd2a3a80d996240fa0
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Tue May 18 17:36:21 2021 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri May 21 13:31:51 2021 +0200
tdf#55007 tdf#142263 tdf#142268 EMF Properly display ARC and CHORD
With previous implementation the ARC, ARCTO and CHORD were
not displayed if the corners of rectangle was switched.
With this patch the shapes are always displayed correctly.
Change-Id: Ie8ac7af812298c0b96c3b5af417117784f128ce1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115757
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>
(cherry picked from commit 39369c6e67dffe04acc4abb678c1a94526237fd8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115524
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 53be54f34c02..24e2e295e957 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -51,6 +51,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools, public unotest:
void TestTextMapMode();
void TestEnglishMapMode();
void TestRectangleWithModifyWorldTransform();
+ void TestArcInsideWronglyDefinedRectangle();
void TestChordWithModifyWorldTransform();
void TestEllipseWithSelectClipPath();
void TestEllipseXformIntersectClipRect();
@@ -79,6 +80,7 @@ public:
CPPUNIT_TEST(TestTextMapMode);
CPPUNIT_TEST(TestEnglishMapMode);
CPPUNIT_TEST(TestRectangleWithModifyWorldTransform);
+ CPPUNIT_TEST(TestArcInsideWronglyDefinedRectangle);
CPPUNIT_TEST(TestChordWithModifyWorldTransform);
CPPUNIT_TEST(TestEllipseWithSelectClipPath);
CPPUNIT_TEST(TestEllipseXformIntersectClipRect);
@@ -358,6 +360,19 @@ void Test::TestChordWithModifyWorldTransform()
assertXPathContent(pDocument, "/primitive2D/metafile/transform/polygonstroke/polygon", "590,448 436,541 382,598 361,643 385,710 430,731 654,725 919,628");
}
+void Test::TestArcInsideWronglyDefinedRectangle()
+{
+ // tdf#142268 EMF import test with records: ARC
+ Primitive2DSequence aSequence = parseEmf(u"/emfio/qa/cppunit/emf/data/TestArcInsideWronglyDefinedRectangle.emf");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
+ drawinglayer::Primitive2dXmlDump dumper;
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/metafile/transform/polygonhairline", "color", "#000000");
+ assertXPathContent(pDocument, "/primitive2D/metafile/transform/polygonhairline/polygon", "1630,1450 1650,1470 1850,1540 1990,1540 2040,1530 2190,1470 2270,1410 2330,1350 2390,1260 2430,1160 2430,1140 2440,1090 2450,1060 2450,950 2440,930 2430,880 2430,850 2420,820 2360,710 2310,650 2250,590 2110,510 1980,480 1870,480 1770,500 1670,540 1650,560 1630,570 1600,580 1540,640 1460,740 1450,770");
+}
+
void Test::TestEllipseWithSelectClipPath()
{
// EMF import test with records: RECTANGLE, BEGINPATH, ENDPATH, ELLIPSE
diff --git a/emfio/qa/cppunit/emf/data/TestArcInsideWronglyDefinedRectangle.emf b/emfio/qa/cppunit/emf/data/TestArcInsideWronglyDefinedRectangle.emf
new file mode 100644
index 000000000000..3a785fba6cac
Binary files /dev/null and b/emfio/qa/cppunit/emf/data/TestArcInsideWronglyDefinedRectangle.emf differ
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index f4631dfb1d86..8b4727782350 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -230,11 +230,14 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c
const tools::Long nWidth = rBound.GetWidth();
const tools::Long nHeight = rBound.GetHeight();
- if( ( nWidth > 1 ) && ( nHeight > 1 ) )
+ if( ( nWidth != 0 ) && ( nHeight != 0 ) )
{
const Point aCenter( rBound.Center() );
- const tools::Long nRadX = aCenter.X() - rBound.Left();
- const tools::Long nRadY = aCenter.Y() - rBound.Top();
+ // tdf#142268 Get Top Left corner of rectangle (the rectangle is not always correctly created)
+ const auto aBoundLeft = rBound.Left() < aCenter.X() ? rBound.Left() : rBound.Right();
+ const auto aBoundTop = rBound.Top() < aCenter.Y() ? rBound.Top() : rBound.Bottom();
+ const tools::Long nRadX = aCenter.X() - aBoundLeft;
+ const tools::Long nRadY = aCenter.Y() - aBoundTop;
sal_uInt16 nPoints;
tools::Long nRadXY;
commit 5e046f9c74977b0db7502fa73e7488c64027a957
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed May 19 10:38:02 2021 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri May 21 13:31:50 2021 +0200
tdf#118637: sw_xhtmlexport: Add unittest
Change-Id: I110404a73ccdbffed788009730967b0efbbaf51f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115785
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
(cherry picked from commit 0655560f1b8aff45954682bb92498570f2000014)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115836
diff --git a/sw/qa/extras/htmlexport/xhtmlexport.cxx b/sw/qa/extras/htmlexport/xhtmlexport.cxx
index 85adfa2b7b49..738e16760c89 100644
--- a/sw/qa/extras/htmlexport/xhtmlexport.cxx
+++ b/sw/qa/extras/htmlexport/xhtmlexport.cxx
@@ -54,6 +54,22 @@ DECLARE_HTMLEXPORT_TEST(testTdf131812, "tdf131812.odt")
!= -1);
}
+DECLARE_HTMLEXPORT_TEST(testTdf118637, "tdf118637.odt")
+{
+ SvStream* pStream = maTempFile.GetStream(StreamMode::READ);
+ CPPUNIT_ASSERT(pStream);
+ sal_uInt64 nLength = pStream->TellEnd();
+ OString aStream(read_uInt8s_ToOString(*pStream, nLength));
+ CPPUNIT_ASSERT(
+ aStream.indexOf(
+ "<div style=\"display:inline; position:relative; left:0cm;\">The formula </div>")
+ != -1);
+ CPPUNIT_ASSERT(
+ aStream.indexOf(
+ "<div style=\"display:inline; position:relative; left:0cm;\">should be inline.</div>")
+ != -1);
+}
+
DECLARE_HTMLEXPORT_TEST(testTdf107696, "tdf107696.odt")
{
SvStream* pStream = maTempFile.GetStream(StreamMode::READ);
diff --git a/sw/qa/extras/odfexport/data/tdf118637.odt b/sw/qa/extras/odfexport/data/tdf118637.odt
new file mode 100644
index 000000000000..c2a8b4f53035
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf118637.odt differ
commit 154e1e7cb8be043000a711cabd1dc922bf71d350
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu May 20 16:39:20 2021 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri May 21 13:31:50 2021 +0200
Adapt to recent LO download.lst changes
Change-Id: Iac481bb016c69bf444cbf4c91f3d0ff79714783c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115882
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in
index aababaf988dd..63adce70ac25 100644
--- a/solenv/flatpak-manifest.in
+++ b/solenv/flatpak-manifest.in
@@ -255,10 +255,10 @@
"dest-filename": "external/tarballs/libfreehand-0.1.2.tar.xz"
},
{
- "url": "https://dev-www.libreoffice.org/src/language-subtag-registry-2020-12-18.tar.bz2",
- "sha256": "62ce680d5db0f28001b64bd57db47f388c13629cdefc9af8e8af0fbe93689ba1",
+ "url": "https://dev-www.libreoffice.org/src/language-subtag-registry-2021-03-05.tar.bz2",
+ "sha256": "ce80e8face06bf2ada363e0c159e3f990c4116fdae9232ca43e6369aa82bf16a",
"type": "file",
- "dest-filename": "external/tarballs/language-subtag-registry-2020-12-18.tar.bz2"
+ "dest-filename": "external/tarballs/language-subtag-registry-2021-03-05.tar.bz2"
},
{
"url": "https://dev-www.libreoffice.org/src/liblangtag-0.6.2.tar.bz2",
commit f008404796d7b28a8e301b2a3f490fa1c4559bbe
Author: Svante Schubert <svante.schubert at gmail.com>
AuthorDate: Thu Sep 10 16:17:37 2020 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri May 21 13:31:49 2021 +0200
HTML MathML update - enabling inline MATHML & fixing duplication (regression from last commit)
Change-Id: I22dba4fef5d1de7e4ef056a2e7f33511fa91318d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111621
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115880
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index ad74d3716b45..b36a1e08fd46 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -386,6 +386,8 @@
<xsl:with-param name="globalData" select="$globalData" />
<xsl:with-param name="previousFrameWidths" select="0"/>
<xsl:with-param name="previousFrameHeights" select="0"/>
+ <xsl:with-param name="leftPosition" select="0" />
+ <xsl:with-param name="stopAtFirstFrame" select="true()" />
<!-- 2DO for me (Svante) - Not used, uncertain 4now...
<xsl:with-param name="pageMarginLeft">
<xsl:call-template name="getPageMarginLeft"/>
@@ -397,6 +399,8 @@
<xsl:with-param name="globalData" select="$globalData" />
<xsl:with-param name="previousFrameWidths" select="0"/>
<xsl:with-param name="previousFrameHeights" select="0"/>
+ <xsl:with-param name="leftPosition" select="0"/>
+
<!-- 2DO for me (Svante) - Not used, uncertain 4now...
<xsl:with-param name="pageMarginLeft">
<xsl:call-template name="getPageMarginLeft"/>
@@ -785,16 +789,12 @@
<xsl:param name="globalData"/>
<xsl:param name="previousFrameWidths" select="0"/>
<xsl:param name="previousFrameHeights" select="0" />
- <!-- it becomes true for siblings after a draw:frame -->
- <xsl:param name="createDiv" select="false()"/>
- <xsl:param name="noDivBefore" select="true()"/>
- <xsl:param name="leftPosition" />
+ <xsl:param name="leftPosition" select="0" />
<xsl:param name="parentMarginLeft" />
- <xsl:param name="frameAlignedToParagraphWithSvgY" />
+ <xsl:param name="stopAtFirstFrame" select="false()" />
<xsl:choose>
- <xsl:when test="name() = 'draw:frame'">
- <xsl:copy-of select="$frameAlignedToParagraphWithSvgY"/>
+ <xsl:when test="name() = 'draw:frame' and not($stopAtFirstFrame)">
<!-- if the first node is a draw:frame create a div -->
<xsl:call-template name="createDrawFrame">
@@ -808,14 +808,14 @@
<xsl:otherwise>
<xsl:variable name="nextSiblingIsFrame" select="name(following-sibling::node()[1]) = 'draw:frame'"/>
<xsl:choose>
- <xsl:when test="$createDiv and normalize-space(.) != ''">
+ <xsl:when test="normalize-space(.) != ''">
<!-- every following frame sibling till the next draw:frame
have to be incapuslated within a div with left indent.
To be moved altogether according the indent (usually right) -->
<xsl:comment>Next 'div' added for floating.</xsl:comment>
<xsl:element name="div">
<xsl:attribute name="style">
- <xsl:text>position:relative; left:</xsl:text>
+ <xsl:text>display:inline; position:relative; left:</xsl:text>
<xsl:value-of select="$leftPosition"/>
<xsl:text>cm;</xsl:text>
</xsl:attribute>
@@ -830,42 +830,38 @@
<xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
<xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
<xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="false()"/>
- <xsl:with-param name="noDivBefore" select="$noDivBefore"/>
- <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
+ <xsl:with-param name="stopAtFirstFrame" select="$stopAtFirstFrame" />
</xsl:apply-templates>
</xsl:if>
</xsl:element>
- <xsl:copy-of select="$frameAlignedToParagraphWithSvgY"/>
<!-- Other draw:frame will be created outside of the div element -->
- <xsl:apply-templates select="following-sibling::draw:frame[1]" mode="frameFloating">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
- <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
- </xsl:apply-templates>
+ <xsl:if test="nextSiblingIsFrame and not(stopAtFirstFrame)">
+ <xsl:apply-templates select="following-sibling::draw:frame[1]" mode="frameFloating">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
+ <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="stopAtFirstFrame" select="$stopAtFirstFrame" />
+ </xsl:apply-templates>
+ </xsl:if>
</xsl:when>
- <xsl:when test="not($createDiv)">
+ <xsl:otherwise>
<xsl:apply-templates select=".">
<xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
</xsl:apply-templates>
- <xsl:if test="not($nextSiblingIsFrame) or $noDivBefore">
+ <xsl:if test="not($nextSiblingIsFrame)">
<xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
<xsl:with-param name="globalData" select="$globalData"/>
<xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
<xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
<xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
<xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="false()"/>
- <xsl:with-param name="noDivBefore" select="$noDivBefore"/>
- <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
+ <xsl:with-param name="stopAtFirstFrame" select="$stopAtFirstFrame" />
</xsl:apply-templates>
</xsl:if>
- </xsl:when>
+ </xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
@@ -876,20 +872,16 @@
<xsl:param name="globalData"/>
<xsl:param name="previousFrameWidths" select="0"/>
<xsl:param name="previousFrameHeights" select="0" />
- <!-- it becomes true for siblings after a draw:frame -->
- <xsl:param name="createDiv" select="false()"/>
- <xsl:param name="noDivBefore" select="true()"/>
<xsl:param name="leftPosition" />
<xsl:param name="parentMarginLeft" />
- <xsl:param name="frameAlignedToParagraphWithSvgY" />
+ <xsl:param name="stopAtFirstFrame" select="false()" />
<xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
<xsl:with-param name="globalData" select="$globalData"/>
<xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
<xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
<xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="false()"/>
- <xsl:with-param name="noDivBefore" select="$noDivBefore"/>
+ <xsl:with-param name="stopAtFirstFrame" select="$stopAtFirstFrame" />
</xsl:apply-templates>
</xsl:template>
@@ -947,6 +939,7 @@
<xsl:param name="previousFrameWidths" select="0"/>
<xsl:param name="previousFrameHeights" select="0" />
<xsl:param name="parentMarginLeft"/>
+ <xsl:param name="stopAtFirstFrame" select="false()" />
<xsl:variable name="parentMarginLeftNew">
<xsl:choose>
@@ -965,7 +958,7 @@
</xsl:choose>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="$parentMarginLeft"/>
+ <xsl:value-of select="normalize-space($parentMarginLeft)" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
@@ -1018,37 +1011,6 @@
</xsl:element>
</xsl:if>
</xsl:if>
-
-
- <!--
- <xsl:variable name="followingSibling" select="following-sibling::node()[1]"/>
- <xsl:choose>
- HEURISTIC: if the frame is anchored on a paragraph and the above gab is big enough to hold a text line,
- move it behind the text
- <xsl:when test="@text:anchor-type='paragraph' and
- (
- ($svgY > 0.5) or
- ($svgX > 4)
- ) and normalize-space($followingSibling) != ''">
- <xsl:apply-templates select="$followingSibling" mode="frameFloating">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeftNew"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="true()"/>
- <xsl:with-param name="noDivBefore" select="false()"/>
- <xsl:with-param name="frameAlignedToParagraphWithSvgY">
- <xsl:call-template name="createDrawFrame2">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
- <xsl:with-param name="parentMarginLeftNew" select="$parentMarginLeftNew"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="svgY" select="$svgY"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>-->
<xsl:call-template name="createDrawFrame2">
<xsl:with-param name="globalData" select="$globalData"/>
<xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
@@ -1061,13 +1023,8 @@
<xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
<xsl:with-param name="parentMarginLeft" select="$parentMarginLeftNew"/>
<xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="false()"/>
- <xsl:with-param name="noDivBefore" select="false()"/>
+ <xsl:with-param name="stopAtFirstFrame" select="$stopAtFirstFrame" />
</xsl:apply-templates>
- <!--
-
- </xsl:otherwise>
- </xsl:choose> -->
</xsl:template>
<xsl:template name="createDrawFrame2">
@@ -1095,13 +1052,7 @@
replacement image and keep only the id attribute.
See fdo#66645 -->
<xsl:apply-templates select="@draw:name"/>
- <xsl:text> </xsl:text>
<xsl:apply-templates select="draw:object[1]"/>
- <!-- TODO: do not always add a space after the formula,
- for example when it is followed by a comma, period,
- dash etc This will probably require using regexp
- features like xsl:analyze-string -->
- <xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="style">
@@ -3015,6 +2966,11 @@
</xsl:attribute>
</xsl:template>
+ <!-- our mathml should always be inline the text flow -->
+ <xsl:template match="@display" mode="math">
+ <xsl:attribute name="{local-name()}">inline</xsl:attribute>
+ </xsl:template>
+
<!-- Ignore semantic annotations -->
<xsl:template match="math:semantics" mode="math">
<xsl:apply-templates select="*[1]" mode="math"/>
commit 938d8ddf59cb2a99ffc1a58fddf13365d51e4376
Author: Svante Schubert <svante.schubert at gmail.com>
AuthorDate: Wed Sep 9 15:27:54 2020 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri May 21 13:31:49 2021 +0200
tdf#118637: HTML XSLT: Adding missing MathML siblings.
The floating draw:frame sibling content being text were not shown, nor further occuring draw:frame (other MathML)
Change-Id: Ifc5cdd4c58bdf01ceebcf10c01b85cdf96b60d26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111620
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115879
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 83171a1f4d1a..ad74d3716b45 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -380,8 +380,20 @@
</xsl:apply-templates>
<!-- the footnote symbol is the prefix for a footnote in the footer -->
<xsl:copy-of select="$footnotePrefix"/>
- <!-- start floating of frame (and siblings) -->
- <xsl:apply-templates select="node()[1]" mode="frameFloating">
+ <!-- deal with none draw:frame ahead of the <draw:frame> -->
+ <xsl:if test="name(node()[1]) != 'draw:frame'">
+ <xsl:apply-templates select="node()[1]" mode="frameFloating">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="previousFrameWidths" select="0"/>
+ <xsl:with-param name="previousFrameHeights" select="0"/>
+ <!-- 2DO for me (Svante) - Not used, uncertain 4now...
+ <xsl:with-param name="pageMarginLeft">
+ <xsl:call-template name="getPageMarginLeft"/>
+ </xsl:with-param>-->
+ </xsl:apply-templates>
+ </xsl:if>
+ <!-- start floating of frames (each take care of its siblings till next draw:frame) -->
+ <xsl:apply-templates select="draw:frame" mode="frameFloating">
<xsl:with-param name="globalData" select="$globalData" />
<xsl:with-param name="previousFrameWidths" select="0"/>
<xsl:with-param name="previousFrameHeights" select="0"/>
@@ -876,7 +888,7 @@
<xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
<xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
<xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="$createDiv"/>
+ <xsl:with-param name="createDiv" select="false()"/>
<xsl:with-param name="noDivBefore" select="$noDivBefore"/>
</xsl:apply-templates>
</xsl:template>
@@ -1049,7 +1061,7 @@
<xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
<xsl:with-param name="parentMarginLeft" select="$parentMarginLeftNew"/>
<xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="true()"/>
+ <xsl:with-param name="createDiv" select="false()"/>
<xsl:with-param name="noDivBefore" select="false()"/>
</xsl:apply-templates>
<!--
commit 552d0a496928b15141475846fbb7ab50753b0e8d
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 19 09:46:54 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri May 21 13:31:48 2021 +0200
tdf#142370 a null response callback should be acceptable
commit 7f032b2f16fad56beea1df826eb59c6f85c71268
Date: Sat Apr 3 01:24:30 2021 -0500
tdf#127533 Make Tip-of-the-Day dialog non-modal and allow multiple tips to open
calls StartExecuteAsync(nullptr) so there is no callback function for
the response which is a little unusual.
The generic backend protects against a null callback hidden behind
maEndCtx.isSet() before calling aEndCtx.maEndDialogFn() where isSet()
checks for a null maEndDialogFn() so do the same for the gtk backend.
Change-Id: Ib5346be37bfba035a00649ff7fb1d66532739721
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115788
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 6cc773e0aca2..ce4538af47a7 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7062,7 +7062,8 @@ void GtkInstanceDialog::asyncresponse(gint ret)
m_nCancelSignalId = 0;
m_nSignalDeleteId = 0;
- aFunc(GtkToVcl(ret));
+ if (aFunc)
+ aFunc(GtkToVcl(ret));
if (nResponseSignalId)
g_signal_handler_disconnect(m_pDialog, nResponseSignalId);
commit c49073f969f281c931cd16d464b3df83a739f7ab
Author: U-DESKTOP-042UROI\dhsung <sungdh86+git at gmail.com>
AuthorDate: Wed May 19 20:26:06 2021 +0900
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri May 21 13:31:48 2021 +0200
Delete duplicated item in Korean autocorr list
Delete duplicated item in Korean autocurr list (DocumentList.xml)
Change-Id: I3cfaf27abb859dbcfc849082932006d20d0b22ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115799
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit be622ccf9b60290d0577314ac9d76fbcf1cce636)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115832
diff --git a/extras/source/autocorr/lang/ko/DocumentList.xml b/extras/source/autocorr/lang/ko/DocumentList.xml
index 1cbf7330c36c..6f045f5e1086 100644
--- a/extras/source/autocorr/lang/ko/DocumentList.xml
+++ b/extras/source/autocorr/lang/ko/DocumentList.xml
@@ -2379,7 +2379,6 @@
<block-list:block block-list:abbreviated-name="느지막히" block-list:name="느지막이"/>
<block-list:block block-list:abbreviated-name="능이" block-list:name="능히"/>
<block-list:block block-list:abbreviated-name="단언컨데" block-list:name="단언컨대"/>
- <block-list:block block-list:abbreviated-name="단언컨데" block-list:name="단언컨대"/>
<block-list:block block-list:abbreviated-name="닭계장" block-list:name="닭개장"/>
<block-list:block block-list:abbreviated-name="당췌" block-list:name="당최"/>
<block-list:block block-list:abbreviated-name="대표값" block-list:name="대푯값"/>
commit 80061a6f8265ae39fcf1d2e393fdbababb5456a4
Author: Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Mon May 10 16:41:54 2021 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri May 21 13:31:47 2021 +0200
tdf#138209 ODF export: work around forms problem in LO < 7.0
LO without commit 519d96fd8b83ef4c61576d87b58f97b7e6e6e3c6 makes a mess
when storing form documents it has loaded from ODF 1.3 documents: the
XML parts are stored as ODF 1.2, but the storage (and therefore manifest
entry) keeps version 1.3.
To avoid this, store form documents as ODF 1.2 extended by default.
Unfortunately a bunch of ODF export code accesses the global
SvtSaveOptions variable; with this version override, only
SvXMLExport::getSaneDefaultVersion() must be used.
Change-Id: I5fa8e286f5103c578ed0d93da07a8a6cbe2f0ddd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115357
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
(cherry picked from commit 16de54a5c47fbc4691ee099c1f7bb559a8fe11ac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115390
Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx
index 4bf8a063afed..7de37be88b43 100644
--- a/dbaccess/source/filter/xml/xmlExport.cxx
+++ b/dbaccess/source/filter/xml/xmlExport.cxx
@@ -1076,7 +1076,7 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
std::vector< XMLPropertyState > aPropertyStates;
for (const auto & i : pExportHelper)
{
- aPropertyStates = i.first->Filter(_xProp);
+ aPropertyStates = i.first->Filter(*this, _xProp);
if ( !aPropertyStates.empty() )
i.second.first->emplace( _xProp,GetAutoStylePool()->Add( i.second.second, aPropertyStates ) );
}
@@ -1090,7 +1090,7 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
GetFontAutoStylePool()->Add(aFont.Name,aFont.StyleName,static_cast<FontFamily>(aFont.Family),
static_cast<FontPitch>(aFont.Pitch),aFont.CharSet );
- m_aCurrentPropertyStates = m_xCellExportHelper->Filter(_xProp);
+ m_aCurrentPropertyStates = m_xCellExportHelper->Filter(*this, _xProp);
if ( !m_aCurrentPropertyStates.empty() && !xCollection->hasElements() )
{
Reference< XDataDescriptorFactory> xFac(xCollection,UNO_QUERY);
@@ -1121,7 +1121,7 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
};
for (const auto & i : pExportHelper)
{
- std::vector< XMLPropertyState > aPropStates = i.first->Filter( _xProp );
+ std::vector< XMLPropertyState > aPropStates = i.first->Filter(*this, _xProp);
if ( !aPropStates.empty() )
{
const rtl::Reference < XMLPropertySetMapper >& pStyle = i.first->getPropertySetMapper();
diff --git a/include/xmloff/xmlexppr.hxx b/include/xmloff/xmlexppr.hxx
index f2f1e6adf72e..5e47201a5234 100644
--- a/include/xmloff/xmlexppr.hxx
+++ b/include/xmloff/xmlexppr.hxx
@@ -64,6 +64,7 @@ protected:
After this process It'll called 'Contextfilter' for application-specific
filter-processes. */
std::vector<XMLPropertyState> Filter_(
+ SvXMLExport const& rExport,
const css::uno::Reference<css::beans::XPropertySet>& rPropSet,
bool bDefault, bool bDisableFoFontFamily ) const;
@@ -114,6 +115,7 @@ public:
After this process It'll called 'Contextfilter' for application-specific
filter-processes. */
std::vector<XMLPropertyState> Filter(
+ SvXMLExport const& rExport,
const css::uno::Reference<css::beans::XPropertySet>& rPropSet, bool bEnableFoFontFamily = false ) const;
/** Like Filter(), except that:
@@ -122,6 +124,7 @@ public:
* - instead of the property's value, its default value is exported.
*/
std::vector<XMLPropertyState> FilterDefaults(
+ SvXMLExport const& rExport,
const css::uno::Reference<css::beans::XPropertySet>& rPropSet ) const;
/** Provides a partial ordering over two arrays of XMLPropertyState,
diff --git a/include/xmloff/xmluconv.hxx b/include/xmloff/xmluconv.hxx
index 647472d2b7b5..b9800b02a805 100644
--- a/include/xmloff/xmluconv.hxx
+++ b/include/xmloff/xmluconv.hxx
@@ -30,6 +30,8 @@
#include <rtl/ustrbuf.hxx>
#include <xmloff/xmltoken.hxx>
+#include <unotools/saveopt.hxx>
+
#include <tools/fldunit.hxx>
namespace com::sun::star {
@@ -90,7 +92,8 @@ public:
SvXMLUnitConverter(
const css::uno::Reference< css::uno::XComponentContext >& xContext,
sal_Int16 eCoreMeasureUnit /*css::util::MeasureUnit*/,
- sal_Int16 eXMLMeasureUnit /*css::util::MeasureUnit*/);
+ sal_Int16 eXMLMeasureUnit /*css::util::MeasureUnit*/,
+ SvtSaveOptions::ODFSaneDefaultVersion const nODFVersion);
~SvXMLUnitConverter();
@@ -105,6 +108,10 @@ public:
/** gets the default unit for textual measures */
sal_Int16 GetXMLMeasureUnit() const;
+ /// ODF version, only when exporting
+ SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const;
+ void overrideSaneDefaultVersion(SvtSaveOptions::ODFSaneDefaultVersion const);
+
/** gets XNumberingTypeInfo */
const css::uno::Reference< css::text::XNumberingTypeInfo >& getNumTypeInfo() const;
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index e81e78375ad0..e6e517b52ed1 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -1112,11 +1112,11 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted
const uno::Reference< report::XShape> xShape(_xProp,uno::UNO_QUERY);
if ( xShape.is() )
{
- ::std::vector< XMLPropertyState > aPropertyStates( m_xParaPropMapper->Filter(_xProp) );
+ ::std::vector<XMLPropertyState> aPropertyStates(m_xParaPropMapper->Filter(*this, _xProp));
if ( !aPropertyStates.empty() )
m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XmlStyleFamily::TEXT_PARAGRAPH, aPropertyStates ));
}
- ::std::vector< XMLPropertyState > aPropertyStates( m_xCellStylesExportPropertySetMapper->Filter(_xProp) );
+ ::std::vector<XMLPropertyState> aPropertyStates(m_xCellStylesExportPropertySetMapper->Filter(*this, _xProp));
Reference<XFixedLine> xFixedLine(_xProp,uno::UNO_QUERY);
if ( xFixedLine.is() )
{
@@ -1178,7 +1178,7 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted
xBorderProp->setPropertyValue(it, aEmpty);
}
- ::std::vector< XMLPropertyState > aBorderStates(m_xCellStylesExportPropertySetMapper->Filter(xBorderProp));
+ ::std::vector<XMLPropertyState> aBorderStates(m_xCellStylesExportPropertySetMapper->Filter(*this, xBorderProp));
aPropertyStates.insert( aPropertyStates.end(), aBorderStates.begin(), aBorderStates.end() );
}
else
@@ -1219,7 +1219,7 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted
void ORptExport::exportAutoStyle(const Reference<XSection>& _xProp)
{
- ::std::vector< XMLPropertyState > aPropertyStates( m_xTableStylesExportPropertySetMapper->Filter(_xProp.get()) );
+ ::std::vector<XMLPropertyState> aPropertyStates(m_xTableStylesExportPropertySetMapper->Filter(*this, _xProp.get()));
if ( !aPropertyStates.empty() )
m_aAutoStyleNames.emplace( _xProp.get(),GetAutoStylePool()->Add( XmlStyleFamily::TABLE_TABLE, aPropertyStates ));
}
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 71598827094e..0b060dc132e7 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2001,7 +2001,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
OUString sStyleName;
sal_Int32 nNumberFormat(-1);
sal_Int32 nValidationIndex(-1);
- std::vector< XMLPropertyState > aPropStates(xCellStylesExportPropertySetMapper->Filter( xProperties ));
+ std::vector<XMLPropertyState> aPropStates(xCellStylesExportPropertySetMapper->Filter(*this, xProperties));
std::vector< XMLPropertyState >::iterator aItr(aPropStates.begin());
std::vector< XMLPropertyState >::iterator aEndItr(aPropStates.end());
sal_Int32 nCount(0);
@@ -2135,7 +2135,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
void ScXMLExport::AddStyleFromColumn(const uno::Reference<beans::XPropertySet>& xColumnProperties,
const OUString* pOldName, sal_Int32& rIndex, bool& rIsVisible)
{
- std::vector<XMLPropertyState> aPropStates(xColumnStylesExportPropertySetMapper->Filter(xColumnProperties));
+ std::vector<XMLPropertyState> aPropStates(xColumnStylesExportPropertySetMapper->Filter(*this, xColumnProperties));
if(aPropStates.empty())
return;
@@ -2172,7 +2172,7 @@ void ScXMLExport::AddStyleFromColumn(const uno::Reference<beans::XPropertySet>&
void ScXMLExport::AddStyleFromRow(const uno::Reference<beans::XPropertySet>& xRowProperties,
const OUString* pOldName, sal_Int32& rIndex)
{
- std::vector<XMLPropertyState> aPropStates(xRowStylesExportPropertySetMapper->Filter(xRowProperties));
+ std::vector<XMLPropertyState> aPropStates(xRowStylesExportPropertySetMapper->Filter(*this, xRowProperties));
if(aPropStates.empty())
return;
@@ -2320,7 +2320,7 @@ void ScXMLExport::collectAutoStyles()
uno::Reference<beans::XPropertySet> xTableProperties(xIndex->getByIndex(nTable), uno::UNO_QUERY);
if (xTableProperties.is())
{
- std::vector<XMLPropertyState> aPropStates(xTableStylesExportPropertySetMapper->Filter(xTableProperties));
+ std::vector<XMLPropertyState> aPropStates(xTableStylesExportPropertySetMapper->Filter(*this, xTableProperties));
OUString sName( rTableEntry.maName );
GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TABLE_TABLE, OUString(), aPropStates);
GetAutoStylePool()->RegisterName(XmlStyleFamily::TABLE_TABLE, sName);
@@ -2354,7 +2354,7 @@ void ScXMLExport::collectAutoStyles()
{
if ( !rNoteEntry.maStyleName.isEmpty() )
{
- std::vector<XMLPropertyState> aPropStates(xShapeMapper->Filter(xShapeProperties));
+ std::vector<XMLPropertyState> aPropStates(xShapeMapper->Filter(*this, xShapeProperties));
OUString sName( rNoteEntry.maStyleName );
GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::SD_GRAPHICS_ID, OUString(), aPropStates);
GetAutoStylePool()->RegisterName(XmlStyleFamily::SD_GRAPHICS_ID, sName);
@@ -2362,7 +2362,7 @@ void ScXMLExport::collectAutoStyles()
if ( !rNoteEntry.maTextStyle.isEmpty() )
{
std::vector<XMLPropertyState> aPropStates(
- GetTextParagraphExport()->GetParagraphPropertyMapper()->Filter(xShapeProperties));
+ GetTextParagraphExport()->GetParagraphPropertyMapper()->Filter(*this, xShapeProperties));
OUString sName( rNoteEntry.maTextStyle );
GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_PARAGRAPH, OUString(), aPropStates);
GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_PARAGRAPH, sName);
@@ -2394,7 +2394,7 @@ void ScXMLExport::collectAutoStyles()
lcl_GetEnumerated( xCellText, rNoteParaEntry.maSelection.nStartPara ), uno::UNO_QUERY );
if ( xParaProp.is() )
{
- std::vector<XMLPropertyState> aPropStates(xParaPropMapper->Filter(xParaProp));
+ std::vector<XMLPropertyState> aPropStates(xParaPropMapper->Filter(*this, xParaProp));
OUString sName( rNoteParaEntry.maName );
GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_PARAGRAPH, OUString(), aPropStates);
GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_PARAGRAPH, sName);
@@ -2427,7 +2427,7 @@ void ScXMLExport::collectAutoStyles()
{
pCursor->SetSelection( rNoteTextEntry.maSelection );
- std::vector<XMLPropertyState> aPropStates(xTextPropMapper->Filter(xCursorProp));
+ std::vector<XMLPropertyState> aPropStates(xTextPropMapper->Filter(*this, xCursorProp));
OUString sName( rNoteTextEntry.maName );
GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_TEXT, OUString(), aPropStates);
GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_TEXT, sName);
@@ -2468,7 +2468,7 @@ void ScXMLExport::collectAutoStyles()
continue;
pCursor->SetSelection( rTextEntry.maSelection );
- std::vector<XMLPropertyState> aPropStates(xTextPropMapper->Filter(xCursorProp));
+ std::vector<XMLPropertyState> aPropStates(xTextPropMapper->Filter(*this, xCursorProp));
OUString sName( rTextEntry.maName );
GetAutoStylePool()->AddNamed(sName, XmlStyleFamily::TEXT_TEXT, OUString(), aPropStates);
GetAutoStylePool()->RegisterName(XmlStyleFamily::TEXT_TEXT, sName);
@@ -2498,7 +2498,7 @@ void ScXMLExport::collectAutoStyles()
uno::Reference<beans::XPropertySet> xTableProperties(xTable, uno::UNO_QUERY);
if (xTableProperties.is())
{
- std::vector<XMLPropertyState> aPropStates(xTableStylesExportPropertySetMapper->Filter(xTableProperties));
+ std::vector<XMLPropertyState> aPropStates(xTableStylesExportPropertySetMapper->Filter(*this, xTableProperties));
if(!aPropStates.empty())
{
OUString sName;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 4188ec2a7ef2..29ca6d9a0fed 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -29,6 +29,7 @@
#include <svl/intitem.hxx>
#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XModule.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/document/XExporter.hpp>
@@ -335,7 +336,11 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
try
{
// older versions can not have this property set, it exists only starting from ODF1.2
- if (SvtSaveOptions::ODFSVER_013 <= nDefVersion)
+ uno::Reference<frame::XModule> const xModule(GetModel(), uno::UNO_QUERY);
+ bool const isBaseForm(xModule.is() &&
+ xModule->getIdentifier() == "com.sun.star.sdb.FormDesign");
+ SAL_INFO_IF(isBaseForm, "sfx.doc", "tdf#138209 force form export to ODF 1.2");
+ if (!isBaseForm && SvtSaveOptions::ODFSVER_013 <= nDefVersion)
{
xProps->setPropertyValue("Version", uno::makeAny<OUString>(ODFVER_013_TEXT));
}
@@ -981,7 +986,11 @@ bool SfxObjectShell::DoSave()
{
try // tdf#134582 set Version on embedded objects as they
{ // could have been loaded with a different/old version
- if (SvtSaveOptions::ODFSVER_013 <= nDefVersion)
+ uno::Reference<frame::XModule> const xModule(GetModel(), uno::UNO_QUERY);
+ bool const isBaseForm(xModule.is() &&
+ xModule->getIdentifier() == "com.sun.star.sdb.FormDesign");
+ SAL_INFO_IF(isBaseForm, "sfx.doc", "tdf#138209 force form export to ODF 1.2");
+ if (!isBaseForm && SvtSaveOptions::ODFSVER_013 <= nDefVersion)
{
xProps->setPropertyValue("Version", uno::makeAny<OUString>(ODFVER_013_TEXT));
}
diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx
index ca590f6ddef6..eb5f74ced41d 100644
--- a/sw/source/filter/xml/xmliteme.cxx
+++ b/sw/source/filter/xml/xmliteme.cxx
@@ -196,7 +196,8 @@ inline void SwXMLTableItemMapper_Impl::SetAbsWidth( sal_uInt32 nAbs )
void SwXMLExport::InitItemExport()
{
m_pTwipUnitConverter.reset(new SvXMLUnitConverter(getComponentContext(),
- util::MeasureUnit::TWIP, GetMM100UnitConverter().GetXMLMeasureUnit()));
+ util::MeasureUnit::TWIP, GetMM100UnitConverter().GetXMLMeasureUnit(),
+ getSaneDefaultVersion()));
m_xTableItemMap = new SvXMLItemMapEntries( aXMLTableItemMap );
m_xTableRowItemMap = new SvXMLItemMapEntries( aXMLTableRowItemMap );
diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx
index 54eed769a945..f58407655681 100644
--- a/sw/source/filter/xml/xmlitemi.cxx
+++ b/sw/source/filter/xml/xmlitemi.cxx
@@ -227,7 +227,8 @@ void SwXMLImportTableItemMapper_Impl::finished(
void SwXMLImport::InitItemImport()
{
m_pTwipUnitConv.reset( new SvXMLUnitConverter( GetComponentContext(),
- util::MeasureUnit::TWIP, util::MeasureUnit::TWIP ) );
+ util::MeasureUnit::TWIP, util::MeasureUnit::TWIP,
+ SvtSaveOptions::ODFSVER_LATEST_EXTENDED) );
m_xTableItemMap = new SvXMLItemMapEntries( aXMLTableItemMap );
m_xTableColItemMap = new SvXMLItemMapEntries( aXMLTableColItemMap );
diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx
index 6ce23fb54c68..19cfe8cf6765 100644
--- a/xmloff/source/chart/PropertyMaps.cxx
+++ b/xmloff/source/chart/PropertyMaps.cxx
@@ -436,7 +436,8 @@ void XMLChartExportPropertyMapper::handleSpecialItem(
{
if( ( nValue & chart::ChartDataCaption::PERCENT ) == chart::ChartDataCaption::PERCENT )
{
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFSaneDefaultVersion() );
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(
+ mrExport.getSaneDefaultVersion());
if (nCurrentVersion < SvtSaveOptions::ODFSVER_012)
sValueBuffer.append( GetXMLToken( XML_PERCENTAGE ));
else
@@ -488,7 +489,8 @@ void XMLChartExportPropertyMapper::handleSpecialItem(
break;
case XML_SCH_CONTEXT_SPECIAL_REGRESSION_TYPE:
{
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFSaneDefaultVersion() );
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(
+ mrExport.getSaneDefaultVersion());
OUString aServiceName;
rProperty.maValue >>= aServiceName;
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index b33ebb1ac054..0ee68425c6fc 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -282,7 +282,8 @@ public:
namespace
{
-CustomLabelSeq lcl_getCustomLabelField(sal_Int32 nDataPointIndex,
+CustomLabelSeq lcl_getCustomLabelField(SvXMLExport const& rExport,
+ sal_Int32 nDataPointIndex,
const uno::Reference< chart2::XDataSeries >& rSeries)
{
if (!rSeries.is())
@@ -291,7 +292,7 @@ CustomLabelSeq lcl_getCustomLabelField(sal_Int32 nDataPointIndex,
// Custom data label text will be written to the <text:p> child element of a
// <chart:data-label> element. That exists only since ODF 1.2.
const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
- SvtSaveOptions().GetODFSaneDefaultVersion());
+ rExport.getSaneDefaultVersion());
if (nCurrentODFVersion < SvtSaveOptions::ODFSVER_012)
return CustomLabelSeq();
@@ -307,13 +308,17 @@ CustomLabelSeq lcl_getCustomLabelField(sal_Int32 nDataPointIndex,
return CustomLabelSeq();
}
-css::chart2::RelativePosition lcl_getCustomLabelPosition(sal_Int32 nDataPointIndex,
+css::chart2::RelativePosition lcl_getCustomLabelPosition(
+ SvXMLExport const& rExport,
+ sal_Int32 const nDataPointIndex,
const uno::Reference< chart2::XDataSeries >& rSeries)
{
if (!rSeries.is())
return chart2::RelativePosition();
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ rExport.getSaneDefaultVersion());
+
if ((nCurrentODFVersion & SvtSaveOptions::ODFSVER_EXTENDED) == 0) // do not export to ODF 1.3 or older
return chart2::RelativePosition();
@@ -1182,13 +1187,15 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >
{
Reference< beans::XPropertySet > xPropSet = rChartDoc->getArea();
if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xPropSet);
}
if( bExportContent )
{
//export data provider in xlink:href attribute
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ mrExport.getSaneDefaultVersion());
+
if (nCurrentODFVersion >= SvtSaveOptions::ODFSVER_012)
{
OUString aDataProviderURL( ".." );
@@ -1272,7 +1279,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >
{
Reference< beans::XPropertySet > xPropSet( rChartDoc->getTitle(), uno::UNO_QUERY );
if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xPropSet);
}
if( bExportContent )
{
@@ -1312,7 +1319,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >
{
Reference< beans::XPropertySet > xPropSet( rChartDoc->getSubTitle(), uno::UNO_QUERY );
if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xPropSet);
}
if( bExportContent )
@@ -1353,7 +1360,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >
{
Reference< beans::XPropertySet > xPropSet( rChartDoc->getLegend(), uno::UNO_QUERY );
if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xPropSet);
}
if( bExportContent )
@@ -1361,7 +1368,8 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >
Reference< beans::XPropertySet > xProp( rChartDoc->getLegend(), uno::UNO_QUERY );
if( xProp.is())
{
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ mrExport.getSaneDefaultVersion());
// export legend anchor position
try
@@ -1864,7 +1872,7 @@ void SchXMLExportHelper_Impl::exportPlotArea(
if( xPropSet.is())
{
if( mxExpPropMapper.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xPropSet);
}
if( bExportContent )
{
@@ -1983,7 +1991,7 @@ void SchXMLExportHelper_Impl::exportPlotArea(
if( xStockPropSet.is())
{
aPropertyStates.clear();
- aPropertyStates = mxExpPropMapper->Filter( xStockPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xStockPropSet);
if( !aPropertyStates.empty() )
{
@@ -2005,7 +2013,7 @@ void SchXMLExportHelper_Impl::exportPlotArea(
if( xStockPropSet.is())
{
aPropertyStates.clear();
- aPropertyStates = mxExpPropMapper->Filter( xStockPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xStockPropSet);
if( !aPropertyStates.empty() )
{
@@ -2027,7 +2035,7 @@ void SchXMLExportHelper_Impl::exportPlotArea(
if( xStockPropSet.is())
{
aPropertyStates.clear();
- aPropertyStates = mxExpPropMapper->Filter( xStockPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xStockPropSet);
if( !aPropertyStates.empty() )
{
@@ -2058,7 +2066,7 @@ void SchXMLExportHelper_Impl::exportPlotArea(
Reference< beans::XPropertySet > xWallPropSet = xWallFloorSupplier->getWall();
if( xWallPropSet.is())
{
- aPropertyStates = mxExpPropMapper->Filter( xWallPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xWallPropSet);
if( !aPropertyStates.empty() )
{
@@ -2085,7 +2093,7 @@ void SchXMLExportHelper_Impl::exportPlotArea(
if( !xFloorPropSet.is())
return;
- aPropertyStates = mxExpPropMapper->Filter( xFloorPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xFloorPropSet);
if( aPropertyStates.empty() )
return;
@@ -2106,7 +2114,8 @@ void SchXMLExportHelper_Impl::exportPlotArea(
void SchXMLExportHelper_Impl::exportCoordinateRegion( const uno::Reference< chart::XDiagram >& xDiagram )
{
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ mrExport.getSaneDefaultVersion());
if (nCurrentODFVersion <= SvtSaveOptions::ODFSVER_012) //do not export to ODF 1.2 or older
return;
@@ -2177,7 +2186,7 @@ void SchXMLExportHelper_Impl::exportAxisTitle( const Reference< beans::XProperty
{
if( !rTitleProps.is() )
return;
- std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( rTitleProps );
+ std::vector<XMLPropertyState> aPropertyStates = mxExpPropMapper->Filter(mrExport, rTitleProps);
if( bExportContent )
{
OUString aText;
@@ -2205,7 +2214,7 @@ void SchXMLExportHelper_Impl::exportGrid( const Reference< beans::XPropertySet >
{
if( !rGridProperties.is() )
return;
- std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( rGridProperties );
+ std::vector<XMLPropertyState> aPropertyStates = mxExpPropMapper->Filter(mrExport, rGridProperties);
if( bExportContent )
{
AddAutoStyleAttribute( aPropertyStates );
@@ -2229,7 +2238,8 @@ bool lcl_exportAxisType( const Reference< chart2::XAxis >& rChart2Axis, SvXMLExp
if( !rChart2Axis.is() )
return bExportDateScale;
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ rExport.getSaneDefaultVersion());
if ((nCurrentODFVersion & SvtSaveOptions::ODFSVER_EXTENDED) == 0) //do not export to ODF 1.3 or older
return bExportDateScale;
@@ -2302,7 +2312,8 @@ void SchXMLExportHelper_Impl::exportAxis(
// get property states for autostyles
if( rAxisProps.is() && mxExpPropMapper.is() )
{
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ mrExport.getSaneDefaultVersion());
if (nCurrentODFVersion & SvtSaveOptions::ODFSVER_EXTENDED
&& eDimension == XML_X)
{
@@ -2318,7 +2329,7 @@ void SchXMLExportHelper_Impl::exportAxis(
}
lcl_exportNumberFormat( "NumberFormat", rAxisProps, mrExport );
- aPropertyStates = mxExpPropMapper->Filter( rAxisProps );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, rAxisProps);
if (!maSrcShellID.isEmpty() && !maDestShellID.isEmpty() && maSrcShellID != maDestShellID)
{
@@ -2727,7 +2738,8 @@ void SchXMLExportHelper_Impl::exportSeries(
TOOLS_INFO_EXCEPTION("xmloff.chart", "Required property not found in DataRowProperties" );
}
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ mrExport.getSaneDefaultVersion());
if (nCurrentODFVersion >= SvtSaveOptions::ODFSVER_012)
{
lcl_exportNumberFormat( "NumberFormat", xPropSet, mrExport );
@@ -2735,7 +2747,7 @@ void SchXMLExportHelper_Impl::exportSeries(
}
if( mxExpPropMapper.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xPropSet);
}
if( bExportContent )
@@ -2760,7 +2772,8 @@ void SchXMLExportHelper_Impl::exportSeries(
// #i75297# allow empty series, export empty range to have all ranges on import
mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_VALUES_CELL_RANGE_ADDRESS, OUString());
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ mrExport.getSaneDefaultVersion());
if (nCurrentODFVersion & SvtSaveOptions::ODFSVER_EXTENDED) // do not export to ODF 1.3 or older
{
if (xPropSet.is())
@@ -2898,7 +2911,7 @@ void SchXMLExportHelper_Impl::exportSeries(
if( xStatProp.is() )
{
- aPropertyStates = mxExpPropMapper->Filter( xStatProp );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xStatProp);
if( !aPropertyStates.empty() )
{
@@ -2931,7 +2944,8 @@ void SchXMLExportHelper_Impl::exportSeries(
uno::Reference< beans::XPropertySet >( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY ),
nSeriesLength, xNewDiagram, bExportContent );
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ mrExport.getSaneDefaultVersion());
// create <chart:data-label> child element if needed.
if (xPropSet.is() && mxExpPropMapper.is())
@@ -3042,7 +3056,7 @@ void SchXMLExportHelper_Impl::exportRegressionCurve(
OUString aService = xServiceName->getServiceName();
- std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( xProperties );
+ std::vector<XMLPropertyState> aPropertyStates = mxExpPropMapper->Filter(mrExport, xProperties);
// Add service name (which is regression type)
sal_Int32 nIndex = GetPropertySetMapper()->FindEntryIndex(XML_SCH_CONTEXT_SPECIAL_REGRESSION_TYPE);
@@ -3057,7 +3071,8 @@ void SchXMLExportHelper_Impl::exportRegressionCurve(
xEquationProperties->getPropertyValue( "ShowCorrelationCoefficient") >>= bShowRSquared;
bExportEquation = ( bShowEquation || bShowRSquared );
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(
+ mrExport.getSaneDefaultVersion());
if (nCurrentVersion < SvtSaveOptions::ODFSVER_012)
{
bExportEquation=false;
@@ -3071,7 +3086,7 @@ void SchXMLExportHelper_Impl::exportRegressionCurve(
{
mrExport.addDataStyle( nNumberFormat );
}
- aEquationPropertyStates = mxExpPropMapper->Filter( xEquationProperties );
+ aEquationPropertyStates = mxExpPropMapper->Filter(mrExport, xEquationProperties);
}
}
@@ -3132,7 +3147,8 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe
{
assert(mxExpPropMapper.is());
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(
+ mrExport.getSaneDefaultVersion());
/// Don't export X ErrorBars for older ODF versions.
if (!bYError && nCurrentVersion < SvtSaveOptions::ODFSVER_012)
@@ -3182,7 +3198,7 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe
}
}
- std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( xErrorBarProp );
+ std::vector<XMLPropertyState> aPropertyStates = mxExpPropMapper->Filter(mrExport, xErrorBarProp);
if( aPropertyStates.empty() )
return;
@@ -3347,7 +3363,8 @@ void SchXMLExportHelper_Impl::exportDataPoints(
xSeriesProperties->getPropertyValue("AttributedDataPoints") >>= aDataPointSeq;
xSeriesProperties->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint;
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ mrExport.getSaneDefaultVersion());
if (nCurrentODFVersion & SvtSaveOptions::ODFSVER_EXTENDED) // do not export to ODF 1.3 or older
xSeriesProperties->getPropertyValue("DeletedLegendEntries") >>= deletedLegendEntriesSeq;
}
@@ -3401,7 +3418,8 @@ void SchXMLExportHelper_Impl::exportDataPoints(
SAL_WARN_IF( !xPropSet.is(), "xmloff.chart", "Pie Segments should have properties" );
if( xPropSet.is())
{
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ mrExport.getSaneDefaultVersion());
if (nCurrentODFVersion >= SvtSaveOptions::ODFSVER_012 && bExportNumFmt)
{
lcl_exportNumberFormat( "NumberFormat", xPropSet, mrExport );
@@ -3426,7 +3444,7 @@ void SchXMLExportHelper_Impl::exportDataPoints(
}
}
- aPropertyStates = mxExpPropMapper->Filter(xPropSet);
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xPropSet);
if (!aPropertyStates.empty() || !aDataLabelPropertyStates.empty())
{
if (bExportContent)
@@ -3448,8 +3466,8 @@ void SchXMLExportHelper_Impl::exportDataPoints(
maAutoStyleNameQueue.pop();
}
if(bExportNumFmt)
- aPoint.mCustomLabelText = lcl_getCustomLabelField(nElement, xSeries);
- aPoint.mCustomLabelPos = lcl_getCustomLabelPosition(nElement, xSeries);
+ aPoint.mCustomLabelText = lcl_getCustomLabelField(mrExport, nElement, xSeries);
+ aPoint.mCustomLabelPos = lcl_getCustomLabelPosition(mrExport, nElement, xSeries);
aDataPointVector.push_back( aPoint );
}
@@ -3497,7 +3515,8 @@ void SchXMLExportHelper_Impl::exportDataPoints(
}
if( xPropSet.is())
{
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ mrExport.getSaneDefaultVersion());
if (nCurrentODFVersion >= SvtSaveOptions::ODFSVER_012)
{
lcl_exportNumberFormat( "NumberFormat", xPropSet, mrExport );
@@ -3511,7 +3530,7 @@ void SchXMLExportHelper_Impl::exportDataPoints(
mxExpPropMapper);
}
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
+ aPropertyStates = mxExpPropMapper->Filter(mrExport, xPropSet);
if (!aPropertyStates.empty() || !aDataLabelPropertyStates.empty())
{
@@ -3526,8 +3545,8 @@ void SchXMLExportHelper_Impl::exportDataPoints(
aPoint.maStyleName = maAutoStyleNameQueue.front();
maAutoStyleNameQueue.pop();
}
- aPoint.mCustomLabelText = lcl_getCustomLabelField(nCurrIndex, xSeries);
- aPoint.mCustomLabelPos = lcl_getCustomLabelPosition(nCurrIndex, xSeries);
+ aPoint.mCustomLabelText = lcl_getCustomLabelField(mrExport, nCurrIndex, xSeries);
+ aPoint.mCustomLabelPos = lcl_getCustomLabelPosition(mrExport, nCurrIndex, xSeries);
if (!aDataLabelPropertyStates.empty())
{
SAL_WARN_IF(maAutoStyleNameQueue.empty(), "xmloff.chart",
diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index 6ac7475a1afd..80f9481ced18 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -609,7 +609,8 @@ void exportRangeToSomewhere( SvXMLExport& rExport, const OUString& rValue )
//#i113950# first the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore within ODF 1.2
//as an alternative the range info is now saved into the description at an empty group element (not very nice, but ODF conform)
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentODFVersion(
+ rExport.getSaneDefaultVersion());
if (nCurrentODFVersion == SvtSaveOptions::ODFSVER_010 || nCurrentODFVersion == SvtSaveOptions::ODFSVER_011)
return;//svg:desc is not allowed at draw:g in ODF1.0; but as the ranges for error bars are anyhow not allowed within ODF1.0 nor ODF1.1 we do not need the information
diff --git a/xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx b/xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx
index 0a14b506352a..c50450740db3 100644
--- a/xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx
+++ b/xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx
@@ -18,6 +18,8 @@
*/
#include "XMLErrorBarStylePropertyHdl.hxx"
+
+#include <xmloff/xmluconv.hxx>
#include <unotools/saveopt.hxx>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
@@ -35,10 +37,10 @@ XMLErrorBarStylePropertyHdl::~XMLErrorBarStylePropertyHdl()
}
bool XMLErrorBarStylePropertyHdl::exportXML( OUString& rStrExpValue,
- const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
+ const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter) const
{
uno::Any aValue(rValue);
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(rUnitConverter.getSaneDefaultVersion());
if (nCurrentVersion < SvtSaveOptions::ODFSVER_012)
{
sal_Int32 nValue = 0;
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index a6b22c178729..732ea6a453fb 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -22,6 +22,7 @@
#include <sal/log.hxx>
#include <stack>
+#include <optional>
#include <xmloff/unointerfacetouniqueidentifiermapper.hxx>
#include <osl/mutex.hxx>
@@ -58,6 +59,7 @@
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XModule.hpp>
#include <xmloff/GradientStyle.hxx>
#include <xmloff/HatchStyle.hxx>
#include <xmloff/ImageStyle.hxx>
@@ -260,6 +262,7 @@ public:
uno::Reference< embed::XStorage > mxTargetStorage;
SvtSaveOptions maSaveOptions;
+ std::optional<SvtSaveOptions::ODFSaneDefaultVersion> m_oOverrideODFVersion;
/// name of stream in package, e.g., "content.xml"
OUString mStreamName;
@@ -418,6 +421,32 @@ void SvXMLExport::DetermineModelType_()
if ( mxModel.is() )
{
meModelType = SvtModuleOptions::ClassifyFactoryByModel( mxModel );
+
+ // note: MATH documents will throw NotInitializedException; maybe unit test problem
+ if (meModelType == SvtModuleOptions::EFactory::WRITER)
+ {
+ uno::Reference<frame::XModule> const xModule(mxModel, uno::UNO_QUERY);
+ bool const isBaseForm(xModule.is() &&
+ xModule->getIdentifier() == "com.sun.star.sdb.FormDesign");
+ if (isBaseForm)
+ {
+ switch (mpImpl->maSaveOptions.GetODFSaneDefaultVersion())
+ {
+ case SvtSaveOptions::ODFSVER_013_EXTENDED:
+ SAL_INFO("xmloff.core", "tdf#138209 force form export to ODF 1.2");
+ mpImpl->m_oOverrideODFVersion = SvtSaveOptions::ODFSVER_012_EXTENDED;
+ maUnitConv.overrideSaneDefaultVersion(SvtSaveOptions::ODFSVER_012_EXTENDED);
+ break;
+ case SvtSaveOptions::ODFSVER_013:
+ SAL_INFO("xmloff.core", "tdf#138209 force form export to ODF 1.2");
+ mpImpl->m_oOverrideODFVersion = SvtSaveOptions::ODFSVER_012;
+ maUnitConv.overrideSaneDefaultVersion(SvtSaveOptions::ODFSVER_012);
+ break;
+ default:
+ break;
+ }
+ }
+ }
}
}
@@ -430,7 +459,7 @@ SvXMLExport::SvXMLExport(
m_xContext(xContext), m_implementationName(implementationName),
mxAttrList( new SvXMLAttributeList ),
mpNamespaceMap( new SvXMLNamespaceMap ),
- maUnitConv( xContext, util::MeasureUnit::MM_100TH, eDefaultMeasureUnit ),
+ maUnitConv(xContext, util::MeasureUnit::MM_100TH, eDefaultMeasureUnit, getSaneDefaultVersion()),
meClass( eClass ),
mnExportFlags( nExportFlags ),
mnErrorFlags( SvXMLErrorFlags::NO ),
@@ -455,7 +484,7 @@ SvXMLExport::SvXMLExport(
mxAttrList( new SvXMLAttributeList ),
msOrigFileName( rFileName ),
mpNamespaceMap( new SvXMLNamespaceMap ),
- maUnitConv( xContext, util::MeasureUnit::MM_100TH, eDefaultMeasureUnit ),
+ maUnitConv(xContext, util::MeasureUnit::MM_100TH, eDefaultMeasureUnit, getSaneDefaultVersion()),
meClass( XML_TOKEN_INVALID ),
mnExportFlags( SvXMLExportFlags::NONE ),
mnErrorFlags( SvXMLErrorFlags::NO ),
@@ -490,7 +519,8 @@ SvXMLExport::SvXMLExport(
mpNamespaceMap( new SvXMLNamespaceMap ),
maUnitConv( xContext,
util::MeasureUnit::MM_100TH,
- SvXMLUnitConverter::GetMeasureUnit(eDefaultFieldUnit) ),
+ SvXMLUnitConverter::GetMeasureUnit(eDefaultFieldUnit),
+ getSaneDefaultVersion()),
meClass( XML_TOKEN_INVALID ),
mnExportFlags( nExportFlag ),
mnErrorFlags( SvXMLErrorFlags::NO ),
@@ -2296,11 +2326,11 @@ uno::Reference< embed::XStorage > const & SvXMLExport::GetTargetStorage() const
SvtSaveOptions::ODFSaneDefaultVersion SvXMLExport::getSaneDefaultVersion() const
{
- if( mpImpl )
- return mpImpl->maSaveOptions.GetODFSaneDefaultVersion();
-
- // fatal error, use current version as default
- return SvtSaveOptions::ODFSVER_LATEST;
+ if (mpImpl->m_oOverrideODFVersion)
+ {
+ return *mpImpl->m_oOverrideODFVersion;
+ }
+ return mpImpl->maSaveOptions.GetODFSaneDefaultVersion();
}
void
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index c66ab63f4479..bc977309b169 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -402,7 +402,8 @@ SvXMLImport::SvXMLImport(
mpNamespaceMap( new SvXMLNamespaceMap ),
mpUnitConv( new SvXMLUnitConverter( xContext,
- util::MeasureUnit::MM_100TH, util::MeasureUnit::MM_100TH) ),
+ util::MeasureUnit::MM_100TH, util::MeasureUnit::MM_100TH,
+ SvtSaveOptions::ODFSVER_LATEST_EXTENDED) ),
mnImportFlags( nImportFlags ),
maNamespaceHandler( new SvXMLImportFastNamespaceHandler() ),
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index b18972ba29f2..9e74d00e214e 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -66,6 +66,7 @@ struct SvXMLUnitConverter::Impl
{
sal_Int16 m_eCoreMeasureUnit; /*css::util::MeasureUnit*/
sal_Int16 m_eXMLMeasureUnit; /*css::util::MeasureUnit*/
+ SvtSaveOptions::ODFSaneDefaultVersion m_eODFVersion;
util::Date m_aNullDate;
mutable uno::Reference< text::XNumberingTypeInfo > m_xNumTypeInfo;
mutable uno::Reference< i18n::XCharacterClassification > m_xCharClass;
@@ -73,9 +74,11 @@ struct SvXMLUnitConverter::Impl
Impl(uno::Reference<uno::XComponentContext> const& xContext,
sal_Int16 const eCoreMeasureUnit,
- sal_Int16 const eXMLMeasureUnit)
+ sal_Int16 const eXMLMeasureUnit,
+ SvtSaveOptions::ODFSaneDefaultVersion const nODFVersion)
: m_eCoreMeasureUnit(eCoreMeasureUnit)
, m_eXMLMeasureUnit(eXMLMeasureUnit)
+ , m_eODFVersion(nODFVersion)
, m_aNullDate(30, 12, 1899)
, m_xContext(xContext)
{
@@ -117,6 +120,17 @@ sal_Int16 SvXMLUnitConverter::GetXMLMeasureUnit() const
return m_pImpl->m_eXMLMeasureUnit;
}
+SvtSaveOptions::ODFSaneDefaultVersion SvXMLUnitConverter::getSaneDefaultVersion() const
+{
+ return m_pImpl->m_eODFVersion;
+}
+
+void SvXMLUnitConverter::overrideSaneDefaultVersion(
+ SvtSaveOptions::ODFSaneDefaultVersion const nODFVersion)
+{
+ m_pImpl->m_eODFVersion = nODFVersion;
+}
+
/** constructs a SvXMLUnitConverter. The core measure unit is the
default unit for numerical measures, the XML measure unit is
the default unit for textual measures
@@ -125,8 +139,9 @@ sal_Int16 SvXMLUnitConverter::GetXMLMeasureUnit() const
SvXMLUnitConverter::SvXMLUnitConverter(
const uno::Reference<uno::XComponentContext>& xContext,
sal_Int16 const eCoreMeasureUnit,
- sal_Int16 const eXMLMeasureUnit)
-: m_pImpl(new Impl(xContext, eCoreMeasureUnit, eXMLMeasureUnit))
+ sal_Int16 const eXMLMeasureUnit,
+ SvtSaveOptions::ODFSaneDefaultVersion const nODFVersion)
+: m_pImpl(new Impl(xContext, eCoreMeasureUnit, eXMLMeasureUnit, nODFVersion))
{
}
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index f7c4410659ed..4fcfed5bb731 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -1524,7 +1524,7 @@ OUString SdXMLExport::ImpCreatePresPageStyleName( const Reference<XDrawPage>& xD
const rtl::Reference< SvXMLExportPropertyMapper > aMapperRef( GetPresPagePropsMapper() );
- std::vector< XMLPropertyState > aPropStates( aMapperRef->Filter( xPropSet ) );
+ std::vector<XMLPropertyState> aPropStates(aMapperRef->Filter(*this, xPropSet));
if( !aPropStates.empty() )
{
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 32cf74b8a799..22e7db685f99 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -391,7 +391,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap
sal_Int32 nCount = 0;
if( !bIsEmptyPresObj || (aShapeInfo.meShapeType != XmlShapeTypePresPageShape) )
{
- aPropStates = GetPropertySetMapper()->Filter( xPropSet );
+ aPropStates = GetPropertySetMapper()->Filter(mrExport, xPropSet);
if (XmlShapeTypeDrawControlShape == aShapeInfo.meShapeType)
{
@@ -442,7 +442,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap
// optionally generate auto style for text attributes
if( (!bIsEmptyPresObj || (aShapeInfo.meShapeType != XmlShapeTypePresPageShape)) && bObjSupportsText )
{
- aPropStates = GetExport().GetTextParagraphExport()->GetParagraphPropertyMapper()->Filter( xPropSet );
+ aPropStates = GetExport().GetTextParagraphExport()->GetParagraphPropertyMapper()->Filter(mrExport, xPropSet);
// yet more additionally, we need to care for the ParaAdjust property
if ( XmlShapeTypeDrawControlShape == aShapeInfo.meShapeType )
diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx
index d2beff0d3786..fb5567fa5ef5 100644
--- a/xmloff/source/forms/layerexport.cxx
+++ b/xmloff/source/forms/layerexport.cxx
@@ -569,7 +569,7 @@ namespace xmloff
// determine a number style, if needed
xColumnPropertiesMeta = xColumnProperties->getPropertySetInfo();
// get the styles of the column
- ::std::vector< XMLPropertyState > aPropertyStates = m_xStyleExportMapper->Filter( xColumnProperties );
+ ::std::vector<XMLPropertyState> aPropertyStates = m_xStyleExportMapper->Filter(m_rContext, xColumnProperties);
// care for the number format, additionally
OUString sColumnNumberStyle;
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx
index 640e11b7094d..3c3fd16e8413 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -71,7 +71,7 @@ void XMLPageExport::collectPageMasterAutoStyle(
SAL_WARN_IF( !xPageMasterPropSetMapper.is(), "xmloff", "page master family/XMLPageMasterPropSetMapper not found" );
if( xPageMasterPropSetMapper.is() )
{
- ::std::vector<XMLPropertyState> aPropStates = xPageMasterExportPropMapper->Filter( rPropSet );
+ ::std::vector<XMLPropertyState> aPropStates = xPageMasterExportPropMapper->Filter(rExport, rPropSet);
if( !aPropStates.empty())
{
OUString sParent;
@@ -84,7 +84,7 @@ void XMLPageExport::collectPageMasterAutoStyle(
}
assert(m_xPageMasterDrawingPageExportPropMapper.is());
::std::vector<XMLPropertyState> const aPropStates(
- m_xPageMasterDrawingPageExportPropMapper->Filter(rPropSet));
+ m_xPageMasterDrawingPageExportPropMapper->Filter(rExport, rPropSet));
if (!aPropStates.empty())
{
OUString sParent;
@@ -267,7 +267,7 @@ void XMLPageExport::exportDefaultStyle()
GetExport().CheckAttrList();
::std::vector< XMLPropertyState > aPropStates =
- xPageMasterExportPropMapper->FilterDefaults( xPropSet );
+ xPageMasterExportPropMapper->FilterDefaults(rExport, xPropSet);
bool bExport = false;
rtl::Reference < XMLPropertySetMapper > aPropMapper(xPageMasterExportPropMapper->getPropertySetMapper());
diff --git a/xmloff/source/style/chrlohdl.cxx b/xmloff/source/style/chrlohdl.cxx
index 2834e519d122..4b6b1aebbf1d 100644
--- a/xmloff/source/style/chrlohdl.cxx
+++ b/xmloff/source/style/chrlohdl.cxx
@@ -218,7 +218,8 @@ bool XMLCharScriptHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue
return true;
}
-bool XMLCharScriptHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
+bool XMLCharScriptHdl::exportXML(OUString& rStrExpValue,
+ const uno::Any& rValue, const SvXMLUnitConverter& rUnitConv) const
{
lang::Locale aLocale;
if(!(rValue >>= aLocale))
@@ -233,7 +234,7 @@ bool XMLCharScriptHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue
if (!aLanguageTag.hasScript())
return false;
- if (SvtSaveOptions().GetODFSaneDefaultVersion() < SvtSaveOptions::ODFSVER_012)
+ if (rUnitConv.getSaneDefaultVersion() < SvtSaveOptions::ODFSVER_012)
return false;
OUString aLanguage, aCountry;
@@ -346,7 +347,8 @@ bool XMLCharRfcLanguageTagHdl::importXML( const OUString& rStrImpValue, uno::Any
return true;
}
-bool XMLCharRfcLanguageTagHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
+bool XMLCharRfcLanguageTagHdl::exportXML(OUString& rStrExpValue,
+ const uno::Any& rValue, const SvXMLUnitConverter& rUnitConv) const
{
lang::Locale aLocale;
if(!(rValue >>= aLocale))
@@ -356,7 +358,7 @@ bool XMLCharRfcLanguageTagHdl::exportXML( OUString& rStrExpValue, const uno::Any
if (aLocale.Variant.isEmpty())
return false;
- if (SvtSaveOptions().GetODFSaneDefaultVersion() < SvtSaveOptions::ODFSVER_012)
+ if (rUnitConv.getSaneDefaultVersion() < SvtSaveOptions::ODFSVER_012)
return false;
rStrExpValue = aLocale.Variant;
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 734318a0ab13..8b4256a3d043 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -361,7 +361,7 @@ bool XMLStyleExport::exportStyle(
// <style:properties>
::std::vector< XMLPropertyState > aPropStates =
- rPropMapper->Filter( xPropSet, true );
+ rPropMapper->Filter(GetExport(), xPropSet, true);
bool const bUseExtensionNamespaceForGraphicProperties(
rXMLFamily != "drawing-page" &&
rXMLFamily != "graphic" &&
@@ -401,7 +401,7 @@ void XMLStyleExport::exportDefaultStyle(
true, true );
// <style:properties>
::std::vector< XMLPropertyState > aPropStates =
- rPropMapper->FilterDefaults( xPropSet );
+ rPropMapper->FilterDefaults(GetExport(), xPropSet);
rPropMapper->exportXML( GetExport(), aPropStates,
SvXmlExportFlags::IGN_WS );
}
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 893e0fb36ee4..f252822c6314 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -520,18 +520,21 @@ void SvXMLExportPropertyMapper::ChainExportMapper(
}
std::vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter(
+ SvXMLExport const& rExport,
const uno::Reference<beans::XPropertySet>& rPropSet, bool bEnableFoFontFamily ) const
{
- return Filter_(rPropSet, false, bEnableFoFontFamily);
+ return Filter_(rExport, rPropSet, false, bEnableFoFontFamily);
}
std::vector<XMLPropertyState> SvXMLExportPropertyMapper::FilterDefaults(
+ SvXMLExport const& rExport,
const uno::Reference<beans::XPropertySet>& rPropSet ) const
{
- return Filter_(rPropSet, true, false/*bEnableFoFontFamily*/);
+ return Filter_(rExport, rPropSet, true, false/*bEnableFoFontFamily*/);
}
vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter_(
+ SvXMLExport const& rExport,
const Reference<XPropertySet>& xPropSet, bool bDefault, bool bEnableFoFontFamily ) const
{
vector< XMLPropertyState > aPropStateArray;
@@ -553,7 +556,7 @@ vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter_(
if( !pFilterInfo )
{
assert(SvtSaveOptions().GetODFDefaultVersion() != SvtSaveOptions::ODFVER_UNKNOWN);
- const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(SvtSaveOptions().GetODFSaneDefaultVersion());
+ const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(rExport.getSaneDefaultVersion());
pFilterInfo = new FilterPropertiesInfo_Impl;
for( sal_Int32 i=0; i < nProps; i++ )
{
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 194f8e7121a1..65295d41dc3f 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -235,7 +235,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
for( sal_Int32 nColumn = 0; nColumn < nColumnCount; ++nColumn ) try
{
Reference< XPropertySet > xPropSet( xIndexAccessCols->getByIndex(nColumn) , UNO_QUERY_THROW );
- std::vector< XMLPropertyState > aPropStates( mxColumnExportPropertySetMapper->Filter( xPropSet ) );
+ std::vector<XMLPropertyState> aPropStates(mxColumnExportPropertySetMapper->Filter(mrExport, xPropSet));
if( has_states( aPropStates ) )
{
@@ -259,7 +259,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
try
{
Reference< XPropertySet > xPropSet( xIndexAccessRows->getByIndex(nRow) , UNO_QUERY_THROW );
- std::vector< XMLPropertyState > aRowPropStates( mxRowExportPropertySetMapper->Filter( xPropSet ) );
+ std::vector<XMLPropertyState> aRowPropStates(mxRowExportPropertySetMapper->Filter(mrExport, xPropSet));
if( has_states( aRowPropStates ) )
{
@@ -287,7 +287,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
// create auto style, if needed
OUString sStyleName;
- std::vector< XMLPropertyState > aCellPropStates( mxCellExportPropertySetMapper->Filter( xCellSet ) );
+ std::vector<XMLPropertyState> aCellPropStates(mxCellExportPropertySetMapper->Filter(mrExport, xCellSet));
if( has_states( aCellPropStates ) )
sStyleName = mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TABLE_CELL, aCellPropStates);
else
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index d787537e26f0..1b4e15b21e61 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -535,7 +535,7 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily,
SAL_WARN_IF( !xPropMapper.is(), "xmloff", "There is the property mapper?" );
vector< XMLPropertyState > aPropStates =
- xPropMapper->Filter( rPropSet );
+ xPropMapper->Filter(GetExport(), rPropSet);
if( ppAddStates )
{
@@ -667,7 +667,7 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily,
}
SAL_WARN_IF( !xPropMapper.is(), "xmloff", "There is the property mapper?" );
- vector< XMLPropertyState > aPropStates(xPropMapper->Filter( rPropSet ));
+ vector<XMLPropertyState> aPropStates(xPropMapper->Filter(GetExport(), rPropSet));
if( rPropSetHelper.hasProperty( NUMBERING_RULES_AUTO ) )
{
@@ -764,7 +764,7 @@ OUString XMLTextParagraphExport::Find(
SAL_WARN_IF( !xPropMapper.is(), "xmloff", "There is the property mapper?" );
if( !xPropMapper.is() )
return sName;
- vector< XMLPropertyState > aPropStates(xPropMapper->Filter( rPropSet ));
+ vector<XMLPropertyState> aPropStates(xPropMapper->Filter(GetExport(), rPropSet));
if( ppAddStates )
{
while( *ppAddStates )
@@ -787,7 +787,7 @@ OUString XMLTextParagraphExport::FindTextStyleAndHyperlink(
const XMLPropertyState** ppAddStates ) const
{
rtl::Reference < SvXMLExportPropertyMapper > xPropMapper(GetTextPropMapper());
- vector< XMLPropertyState > aPropStates(xPropMapper->Filter( rPropSet ));
+ vector<XMLPropertyState> aPropStates(xPropMapper->Filter(GetExport(), rPropSet));
// Get parent and remove hyperlinks (they aren't of interest)
OUString sName;
commit c7404a537a0e59b7114095e2901c950f6f78f072
Author: Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Wed May 12 14:59:43 2021 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri May 21 13:31:47 2021 +0200
tdf#137810 sw: fix SwXNumberingRules setting CharStyleName
During ODF import, due to removal of the pDocShell parameter, this hits
else
rCharStyleName = sCharFormatName;
while setting the "CharStyleName" property and later
GetNumberingRuleByIndex() prefers m_sNewCharStyleNames over the
format set in the SwCharFormat??
Also, "BulletFontName" has a similar problem; otoh "HeadingStyleName"
only makes sense on chapter numbering.
The m_pDoc and m_pDocShell members are such a WTF.
(regression from ae0e4a6ba9be2fa99ac2be8e20157806e36209b2)
Change-Id: I9d4d4cd7aeb7e6e29221d53facaff213fd4e35a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115495
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
(cherry picked from commit c5e5467f6a13aba68b4706a4d7feb130e824bcc6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115291
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index c1bba2b64bb3..4b3f177fb034 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -147,16 +147,16 @@ private:
OUString m_sNewCharStyleNames[MAXLEVEL];
OUString m_sNewBulletFontNames[MAXLEVEL];
OUString m_sCreatedNumRuleName; //connects to a numbering in SwDoc
- SwDoc* m_pDoc;
+ SwDoc* m_pDoc; // Only if *not* used as chapter numbering.
SwDocShell* m_pDocShell; // Only if used as chapter numbering.
SwNumRule* m_pNumRule;
const SfxItemPropertySet* m_pPropertySet;
bool m_bOwnNumRuleCreated;
protected:
+ SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering
virtual ~SwXNumberingRules() override;
public:
- SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering
SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc = nullptr); // NumRule for paragraphs, numbering styles
SwXNumberingRules(SwDoc& rDoc); //create a new instance
@@ -218,6 +218,7 @@ public:
OUString *const pHeadingStyleName,
OUString *const pParagraphStyleName,
SwDoc *const pDoc,
+ SwDocShell *const pDocShell,
css::uno::Sequence<css::beans::PropertyValue> const& rProperties);
};
diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx
index 895728bd412f..d7f986a0bd59 100644
--- a/sw/qa/extras/unowriter/unowriter.cxx
+++ b/sw/qa/extras/unowriter/unowriter.cxx
@@ -751,6 +751,39 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testImageCommentAtChar)
}
}
+CPPUNIT_TEST_FIXTURE(SwUnoWriter, testChapterNumberingCharStyle)
+{
+ loadURL("private:factory/swriter", nullptr);
+
+ uno::Reference<lang::XMultiServiceFactory> xDoc(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xStyle(
+ xDoc->createInstance("com.sun.star.style.CharacterStyle"), uno::UNO_QUERY);
+ uno::Reference<container::XNamed> xStyleN(xStyle, uno::UNO_QUERY);
+ xStyle->setPropertyValue("CharColor", uno::makeAny(sal_Int32(0x00FF0000)));
+ uno::Reference<style::XStyleFamiliesSupplier> xSFS(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XNameContainer> xStyles(
+ xSFS->getStyleFamilies()->getByName("CharacterStyles"), uno::UNO_QUERY);
+ xStyles->insertByName("red", uno::makeAny(xStyle));
+
+ uno::Reference<text::XChapterNumberingSupplier> xCNS(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexReplace> xOutline(xCNS->getChapterNumberingRules());
+ {
+ comphelper::SequenceAsHashMap hashMap(xOutline->getByIndex(0));
+ hashMap["CharStyleName"] <<= OUString("red");
+ uno::Sequence<beans::PropertyValue> props;
+ hashMap >> props;
+ xOutline->replaceByIndex(0, uno::makeAny(props));
+ }
+ // now rename the style
+ xStyleN->setName("reddishred");
+ {
+ comphelper::SequenceAsHashMap hashMap(xOutline->getByIndex(0));
+
+ // tdf#137810 this failed, was old value "red"
+ CPPUNIT_ASSERT_EQUAL(OUString("reddishred"), hashMap["CharStyleName"].get<OUString>());
+ }
+}
+
CPPUNIT_TEST_FIXTURE(SwUnoWriter, testViewCursorPageStyle)
{
// Load a document with 2 pages, but a single paragraph.
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 26905258e56b..b36bc88a7bef 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1140,6 +1140,7 @@ void SwXNumberingRules::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElemen
SwXNumberingRules::SetNumberingRuleByIndex( aNumRule,
*rProperties, nIndex);
// set character format if needed
+ // this code appears to be dead - except when a style is assigned for BITMAP numbering?
const SwCharFormats* pFormats = m_pDocShell->GetDoc()->GetCharFormats();
const size_t nChCount = pFormats->size();
for(sal_uInt16 i = 0; i < MAXLEVEL;i++)
@@ -1486,7 +1487,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
SetPropertiesToNumFormat(aFormat, m_sNewCharStyleNames[nIndex],
&m_sNewBulletFontNames[nIndex],
&sHeadingStyleName, &sParagraphStyleName,
- m_pDoc, rProperties);
+ m_pDoc, m_pDocShell, rProperties);
if (m_pDoc && !sParagraphStyleName.isEmpty())
@@ -1533,8 +1534,11 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
OUString *const pHeadingStyleName,
OUString *const pParagraphStyleName,
SwDoc *const pDoc,
+ SwDocShell *const pDocShell,
const uno::Sequence<beans::PropertyValue>& rProperties)
{
+ assert(pDoc == nullptr || pDocShell == nullptr); // can't be both ordinary and chapter numbering
+
bool bWrongArg = false;
std::unique_ptr<SvxBrushItem> pSetBrush;
std::unique_ptr<Size> pSetSize;
@@ -1582,14 +1586,15 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
rProp.Value >>= uTmp;
OUString sCharFormatName;
SwStyleNameMapper::FillUIName( uTmp, sCharFormatName, SwGetPoolIdFromName::ChrFmt );
+ SwDoc *const pLocalDoc = pDocShell ? pDocShell->GetDoc() : pDoc;
if (sCharFormatName == UNO_NAME_CHARACTER_FORMAT_NONE)
{
rCharStyleName = aInvalidStyle;
aFormat.SetCharFormat(nullptr);
}
- else if(pDoc)
+ else if (pLocalDoc)
{
- const SwCharFormats* pFormats = pDoc->GetCharFormats();
+ const SwCharFormats* pFormats = pLocalDoc->GetCharFormats();
const size_t nChCount = pFormats->size();
SwCharFormat* pCharFormat = nullptr;
@@ -1608,7 +1613,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
{
SfxStyleSheetBase* pBase;
- SfxStyleSheetBasePool* pPool = pDoc->GetDocShell()->GetStyleSheetPool();
+ SfxStyleSheetBasePool* pPool = pLocalDoc->GetDocShell()->GetStyleSheetPool();
pBase = pPool->Find(sCharFormatName, SfxStyleFamily::Char);
if(!pBase)
pBase = &pPool->Make(sCharFormatName, SfxStyleFamily::Char);
@@ -1620,7 +1625,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
// If the character format has been found its name should not be in the
// char style names array
rCharStyleName.clear();
- }
+ }
else
rCharStyleName = sCharFormatName;
}
@@ -1773,8 +1778,8 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
{
OUString sBulletFontName;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list