[Libreoffice-commits] core.git: sw/qa
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Tue Dec 1 08:04:39 UTC 2020
sw/qa/core/layout/data/textbox-modification.docx |binary
sw/qa/core/layout/layout.cxx | 12 ++++++++++++
2 files changed, 12 insertions(+)
New commits:
commit e5e3fc015520990df851e5d020219cb6c9d1eb11
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Nov 30 21:13:51 2020 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Dec 1 09:04:01 2020 +0100
tdf#137638 sw textbox: make sure layout doesn't mark the doc as modified
Regression from commit c9eb53f200225f2ee6ca695e1326843a487aee51
(tdf#135198 sw editing: text box fell out of its shape, 2020-10-14),
layout may need to adjust the doc model when the position of a draw
shape is known and its textframe has to be re-positioned accordingly.
Make sure that similar to suppressing undo, modify notifications are
also disabled.
This also helps with creating a thumbnail for the start center which
skips thumbnail creation for modified documents.
[ In the meantime commit 59fec754a1523eede0f19a59e4eeeff593a4d688
(tdf#135198 tdf#138050 sw editing: fix text box position sync,
2020-11-16) also fixed this, so drop the actual fix and just keep the
testcase. ]
Change-Id: Id01ccea7d48762f7b4ab297e30ebaa1bbdcd6daa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106918
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/sw/qa/core/layout/data/textbox-modification.docx b/sw/qa/core/layout/data/textbox-modification.docx
new file mode 100644
index 000000000000..6adf1a950e72
Binary files /dev/null and b/sw/qa/core/layout/data/textbox-modification.docx differ
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 2151b870da13..44e09a6ffe54 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -216,6 +216,18 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxAutoGrowVertical)
CPPUNIT_ASSERT(aShapeRect.IsInside(aFlyRect));
}
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextboxModification)
+{
+ // Load a document with a textbox in it: the layout will have to position the shape part.
+ load(DATA_DIRECTORY, "textbox-modification.docx");
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ SwDocShell* pDocShell = pTextDoc->GetDocShell();
+
+ // Without the accompanying fix in place, this test would have failed, as the document was
+ // marked as modified right after the import.
+ CPPUNIT_ASSERT(!pDocShell->IsModified());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list