[Libreoffice-commits] core.git: sw/inc sw/qa sw/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jul 12 11:51:09 UTC 2019
sw/inc/numrule.hxx | 4 ++++
sw/qa/extras/ooxmlexport/data/tdf126245.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 7 +++++++
sw/source/core/doc/number.cxx | 2 ++
sw/source/core/doc/poolfmt.cxx | 3 ++-
sw/source/core/unocore/unocrsrhelper.cxx | 7 +++++++
6 files changed, 22 insertions(+), 1 deletion(-)
New commits:
commit 815205d10993e4cf4f48fcea042263b8f45a348c
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Fri Jul 12 08:58:19 2019 +0200
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Fri Jul 12 13:49:36 2019 +0200
tdf#126245 DOCX export: fix losing of tracked numbering changes
of paragraphs.
Change-Id: I97519630c0f7437c8fdda67c2d94a02c19fc427e
Reviewed-on: https://gerrit.libreoffice.org/75470
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth at numbertext.org>
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index 35d304dff012..30d82dddd1c6 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -134,6 +134,7 @@ private:
bool mbAbsSpaces : 1; ///< Levels represent absolute indents.
bool mbHidden : 1; ///< Is the numbering rule to be hidden in the UI?
bool mbCountPhantoms;
+ bool mbUsedByRedline; /// it needs to export as part of tracked numbering change
const SvxNumberFormat::SvxNumPositionAndSpaceMode meDefaultNumberFormatPositionAndSpaceMode;
OUString msDefaultListId;
@@ -240,6 +241,9 @@ public:
bool IsCountPhantoms() const { return mbCountPhantoms; }
void SetCountPhantoms(bool bCountPhantoms);
+ bool IsUsedByRedline() const { return mbUsedByRedline; }
+ void SetUsedByRedline(bool bUsed ) { mbUsedByRedline = bUsed; }
+
/// Query and set PoolFormat IDs.
sal_uInt16 GetPoolFormatId() const { return mnPoolFormatId; }
void SetPoolFormatId( sal_uInt16 nId ) { mnPoolFormatId = nId; }
diff --git a/sw/qa/extras/ooxmlexport/data/tdf126245.docx b/sw/qa/extras/ooxmlexport/data/tdf126245.docx
new file mode 100644
index 000000000000..7cdc26143176
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf126245.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 25ed3a744e46..98e137327787 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -876,6 +876,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf126243, "tdf120338.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pPrChange/w:pPr/w:pStyle", "val", "Heading 3");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf126245, "tdf126245.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ // export change tracking rejection data for tracked numbering change
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange/w:pPr/w:numPr/w:numId", "val", "1");
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf118691, "tdf118691.docx")
{
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index e8cd7792a1a2..ac882f6f2a9e 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -372,6 +372,7 @@ SwNumRule::SwNumRule( const OUString& rNm,
mbAbsSpaces( false ),
mbHidden( false ),
mbCountPhantoms( true ),
+ mbUsedByRedline( false ),
meDefaultNumberFormatPositionAndSpaceMode( eDefaultNumberFormatPositionAndSpaceMode ),
msDefaultListId()
{
@@ -460,6 +461,7 @@ SwNumRule::SwNumRule( const SwNumRule& rNumRule )
mbAbsSpaces( rNumRule.mbAbsSpaces ),
mbHidden( rNumRule.mbHidden ),
mbCountPhantoms( true ),
+ mbUsedByRedline( false ),
meDefaultNumberFormatPositionAndSpaceMode( rNumRule.meDefaultNumberFormatPositionAndSpaceMode ),
msDefaultListId( rNumRule.msDefaultListId )
{
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index 2f1f20d89175..30ba42f2a577 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -145,7 +145,8 @@ bool SwDoc::IsUsed( const SwTableAutoFormat& rTableAutoFormat) const
bool SwDoc::IsUsed( const SwNumRule& rRule )
{
bool bUsed = rRule.GetTextNodeListSize() > 0 ||
- rRule.GetParagraphStyleListSize() > 0;
+ rRule.GetParagraphStyleListSize() > 0 ||
+ rRule.IsUsedByRedline();
return bUsed;
}
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 6fbe3f75f3c7..27427c5a3bea 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1283,7 +1283,14 @@ void makeRedline( SwPaM const & rPaM,
uno::Reference<container::XNamed> xNumberingRules;
rValue >>= xNumberingRules;
if (xNumberingRules.is())
+ {
aItemSet.Put( SwNumRuleItem( xNumberingRules->getName() ));
+ // keep it during export
+ SwNumRule* pRule = pDoc->FindNumRulePtr(
+ xNumberingRules->getName());
+ if (pRule)
+ pRule->SetUsedByRedline(true);
+ }
}
else
{
More information about the Libreoffice-commits
mailing list