Kaydet (Commit) 0bc56f30 authored tarafından László Németh's avatar László Németh Kaydeden (comit) Xisco Faulí

tdf#125310 change tracking: don't copy page break

at paragraph join, because file saving or changing
to Hide Changes mode don't affect this. Also
adding page breaks to every paragraph of a deletion
is much more annoying, than helpful.

See also commit 1bbbe57d
"change tracking: show layout changes at paragraph join"

Reviewed-on: https://gerrit.libreoffice.org/72469
Tested-by: Jenkins
Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>

 Conflicts:
	sw/qa/extras/uiwriter/uiwriter2.cxx

Change-Id: Ic05f06b9fdb5152b717e824f9a9eaed878fecc2d
Reviewed-on: https://gerrit.libreoffice.org/72778
Tested-by: Jenkins
Reviewed-by: 's avatarXisco Faulí <xiscofauli@libreoffice.org>
üst 0cc10a99
<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
<office:styles>
<style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:class="text" style:master-page-name="">
<style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" loext:contextual-spacing="false" style:page-number="auto" fo:break-before="auto" fo:break-after="auto"/>
<style:text-properties fo:font-size="130%" fo:font-weight="bold" style:font-size-asian="130%" style:font-weight-asian="bold" style:font-size-complex="130%" style:font-weight-complex="bold"/>
</style:style>
</office:styles>
<office:automatic-styles>
<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Heading_20_1" style:master-page-name="Standard">
<style:paragraph-properties style:page-number="auto"/>
</style:style>
</office:automatic-styles>
<office:master-styles>
<style:master-page style:name="Standard" style:page-layout-name="pm1"/>
</office:master-styles>
<office:body>
<office:text>
<text:h text:style-name="P1" text:outline-level="1">This paragraph has got a page break.</text:h>
<text:p>This hasn’t.</text:p>
</office:text>
</office:body>
</office:document>
......@@ -25,6 +25,7 @@
#include <itabenum.hxx>
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
#include <com/sun/star/style/BreakType.hpp>
namespace
{
......@@ -678,4 +679,43 @@ void SwUiWriterTest2::testDocxAttributeTableExport()
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest2);
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf125310)
{
load(DATA_DIRECTORY, "tdf125310.fodt");
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"),
getProperty<OUString>(getParagraph(1), "ParaStyleName"));
CPPUNIT_ASSERT_EQUAL(OUString("Standard"),
getProperty<OUString>(getParagraph(2), "ParaStyleName"));
CPPUNIT_ASSERT_EQUAL(1, getPages());
// turn on red-lining and show changes
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete
| RedlineFlags::ShowInsert);
CPPUNIT_ASSERT_MESSAGE("redlining should be on",
pDoc->getIDocumentRedlineAccess().IsRedlineOn());
CPPUNIT_ASSERT_MESSAGE(
"redlines should be visible",
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
// paragraph join
SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell();
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
pWrtShell->EndPara(/*bSelect=*/true);
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false);
rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell);
pTransfer->Cut();
// copied paragraph style
CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"),
getProperty<OUString>(getParagraph(2), "ParaStyleName"));
// without copying the page break
CPPUNIT_ASSERT_EQUAL(1, getPages());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1924,7 +1924,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall
{
pTextNode = pTextNd->GetTextNode();
if (pTextNode && pDelNode != pTextNode )
pDelNode->CopyCollFormat( *pTextNode );
pTextNode->ChgFormatColl( pDelNode->GetTextColl() );
pTextNd = SwNodes::GoPrevious( &aIdx );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment