1 |
From 4ea419f9423ec43c98521fb824f7f9a24d9ef4a5 Mon Sep 17 00:00:00 2001 |
2 |
From: Michael Stahl <mstahl@redhat.com> |
3 |
Date: Fri, 11 Sep 2015 17:50:44 +0200 |
4 |
Subject: [PATCH] Revert "Fix single node CopyRange" |
5 |
MIME-Version: 1.0 |
6 |
Content-Type: text/plain; charset=UTF-8 |
7 |
Content-Transfer-Encoding: 8bit |
8 |
|
9 |
This reverts commit 9099e21b89184bd4e39def497e483cac4a77ec5a. |
10 |
|
11 |
It causes the problem that frames anchored to the same node where |
12 |
redlines start or end get duplicated during Hide. |
13 |
|
14 |
Jan-Marek said that the original mail-merge related problem this change |
15 |
was fixing is now most likely fixed differently, and the test in |
16 |
testMultiPageAnchoredDraws() still passes. |
17 |
|
18 |
(equivalent master commit e84f0a9b3223f49b0829f2f55dacbf11ae201c1e) |
19 |
|
20 |
sw: add unit test for the redline frame duplication regression |
21 |
(cherry picked from commit d5ffcba07acb4dd5bd68373d40f07af825f07fba) |
22 |
|
23 |
Change-Id: I4c2b425b0dc8d2706cc74ad93a485a501d44c072 |
24 |
Reviewed-on: https://gerrit.libreoffice.org/18510 |
25 |
Reviewed-by: Caolán McNamara <caolanm@redhat.com> |
26 |
Tested-by: Caolán McNamara <caolanm@redhat.com> |
27 |
--- |
28 |
sw/inc/IDocumentContentOperations.hxx | 3 + |
29 |
sw/qa/extras/uiwriter/data/redlineFrame.fodt | 81 ++++++++++++++++++++++ |
30 |
sw/qa/extras/uiwriter/uiwriter.cxx | 27 ++++++++ |
31 |
.../core/doc/DocumentContentOperationsManager.cxx | 58 +++++++--------- |
32 |
sw/source/core/doc/docnew.cxx | 1 + |
33 |
.../core/inc/DocumentContentOperationsManager.hxx | 6 +- |
34 |
6 files changed, 139 insertions(+), 37 deletions(-) |
35 |
create mode 100644 sw/qa/extras/uiwriter/data/redlineFrame.fodt |
36 |
|
37 |
diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx |
38 |
index dbdcd72..d2fdc16 100644 |
39 |
--- a/sw/inc/IDocumentContentOperations.hxx |
40 |
+++ b/sw/inc/IDocumentContentOperations.hxx |
41 |
@@ -70,6 +70,9 @@ public: |
42 |
The position can be in the same or in an another document. It can also |
43 |
be within the range! |
44 |
|
45 |
+ \warning The range has to include at least two nodes or has to be a |
46 |
+ SwDoc::IsColumnSelection! |
47 |
+ |
48 |
Normally this function should work only with content nodes. But there |
49 |
is a special case used by SwDoc::Paste, which starts the SwPaM at the |
50 |
content start node. This position doesn't contain any content: |
51 |
diff --git a/sw/qa/extras/uiwriter/data/redlineFrame.fodt b/sw/qa/extras/uiwriter/data/redlineFrame.fodt |
52 |
new file mode 100644 |
53 |
index 0000000..31c5f50 |
54 |
--- /dev/null |
55 |
+++ b/sw/qa/extras/uiwriter/data/redlineFrame.fodt |
56 |
@@ -0,0 +1,81 @@ |
57 |
+<?xml version="1.0" encoding="UTF-8"?> |
58 |
+ |
59 |
+<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"> |
60 |
+ <office:meta><meta:initial-creator>ms </meta:initial-creator><meta:creation-date>2015-08-24T21:49:45.305718699</meta:creation-date><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="0" meta:word-count="0" meta:character-count="0" meta:non-whitespace-character-count="0"/><meta:generator>LibreOfficeDev/4.3.7.2$Linux_X86_64 LibreOffice_project/8a35821d8636a03b8bf4e15b48f59794652c68ba</meta:generator></office:meta> |
61 |
+ <office:font-face-decls> |
62 |
+ <style:font-face style:name="Lohit Devanagari1" svg:font-family="'Lohit Devanagari'"/> |
63 |
+ <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> |
64 |
+ <style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/> |
65 |
+ <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/> |
66 |
+ <style:font-face style:name="Source Han Sans CN Regular" svg:font-family="'Source Han Sans CN Regular'" style:font-family-generic="system" style:font-pitch="variable"/> |
67 |
+ </office:font-face-decls> |
68 |
+ <office:styles> |
69 |
+ <style:default-style style:family="graphic"> |
70 |
+ <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> |
71 |
+ <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false"> |
72 |
+ <style:tab-stops/> |
73 |
+ </style:paragraph-properties> |
74 |
+ <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Sans CN Regular" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> |
75 |
+ </style:default-style> |
76 |
+ <style:default-style style:family="paragraph"> |
77 |
+ <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> |
78 |
+ <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Sans CN Regular" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/> |
79 |
+ </style:default-style> |
80 |
+ <style:default-style style:family="table"> |
81 |
+ <style:table-properties table:border-model="collapsing"/> |
82 |
+ </style:default-style> |
83 |
+ <style:default-style style:family="table-row"> |
84 |
+ <style:table-row-properties fo:keep-together="auto"/> |
85 |
+ </style:default-style> |
86 |
+ <style:style style:name="Standard" style:family="paragraph" style:class="text"/> |
87 |
+ </office:styles> |
88 |
+ <office:automatic-styles> |
89 |
+ <style:page-layout style:name="pm1"> |
90 |
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm"> |
91 |
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> |
92 |
+ </style:page-layout-properties> |
93 |
+ <style:header-style/> |
94 |
+ <style:footer-style/> |
95 |
+ </style:page-layout> |
96 |
+ |
97 |
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"> |
98 |
+ <style:text-properties officeooo:rsid="000b01fe" officeooo:paragraph-rsid="000b01fe"/> |
99 |
+ </style:style> |
100 |
+ <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"> |
101 |
+ <style:text-properties officeooo:rsid="000b01fe" officeooo:paragraph-rsid="000b01fe"/> |
102 |
+ </style:style> |
103 |
+ <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame"> |
104 |
+ <style:graphic-properties style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph"/> |
105 |
+ </style:style> |
106 |
+ </office:automatic-styles> |
107 |
+ <office:master-styles> |
108 |
+ <style:master-page style:name="Standard" style:page-layout-name="pm1"/> |
109 |
+ </office:master-styles> |
110 |
+ <office:body> |
111 |
+ <office:text> |
112 |
+ |
113 |
+ <text:tracked-changes> |
114 |
+ <text:changed-region xml:id="ct52929984" text:id="ct52929984"> |
115 |
+ <text:insertion> |
116 |
+ <office:change-info> |
117 |
+ <dc:creator>ms </dc:creator> |
118 |
+ <dc:date>2015-09-10T15:36:00</dc:date> |
119 |
+ </office:change-info> |
120 |
+ </text:insertion> |
121 |
+ </text:changed-region> |
122 |
+ <text:changed-region xml:id="ct58510944" text:id="ct58510944"> |
123 |
+ <text:deletion> |
124 |
+ <office:change-info> |
125 |
+ <dc:creator>ms </dc:creator> |
126 |
+ <dc:date>2015-09-10T15:36:00</dc:date> |
127 |
+ </office:change-info> |
128 |
+ <text:p text:style-name="P1"/> |
129 |
+ <text:p text:style-name="P1">Removed text</text:p> |
130 |
+ </text:deletion> |
131 |
+ </text:changed-region> |
132 |
+ </text:tracked-changes> |
133 |
+ <text:p text:style-name="P1"><draw:frame draw:style-name="fr1" draw:name="Frame1" text:anchor-type="char" svg:width="2cm" draw:z-index="0"><draw:text-box fo:min-height="0.499cm"><text:p text:style-name="Frame_20_contents"/></draw:text-box></draw:frame><text:change-start text:change-id="ct52929984"/>Added text<text:change-end text:change-id="ct52929984"/><text:change text:change-id="ct58510944"/></text:p> |
134 |
+ |
135 |
+ </office:text> |
136 |
+ </office:body> |
137 |
+</office:document> |
138 |
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx |
139 |
index e78dc88..0508866 100644 |
140 |
--- a/sw/qa/extras/uiwriter/uiwriter.cxx |
141 |
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx |
142 |
@@ -42,6 +42,7 @@ public: |
143 |
//Regression test of fdo#70143 |
144 |
//EDITING: undo search&replace corrupt text when searching backward |
145 |
void testReplaceBackward(); |
146 |
+ void testRedlineFrame(); |
147 |
void testFdo69893(); |
148 |
void testFdo70807(); |
149 |
void testImportRTF(); |
150 |
@@ -69,6 +70,7 @@ public: |
151 |
CPPUNIT_TEST_SUITE(SwUiWriterTest); |
152 |
CPPUNIT_TEST(testReplaceForward); |
153 |
CPPUNIT_TEST(testReplaceBackward); |
154 |
+ CPPUNIT_TEST(testRedlineFrame); |
155 |
CPPUNIT_TEST(testFdo69893); |
156 |
CPPUNIT_TEST(testFdo70807); |
157 |
CPPUNIT_TEST(testImportRTF); |
158 |
@@ -144,6 +146,31 @@ void SwUiWriterTest::testReplaceForward() |
159 |
CPPUNIT_ASSERT_EQUAL(ORIGINAL_REPLACE_CONTENT, pTxtNode->GetTxt()); |
160 |
} |
161 |
|
162 |
+void SwUiWriterTest::testRedlineFrame() |
163 |
+{ |
164 |
+ SwDoc * pDoc(createDoc("redlineFrame.fodt")); |
165 |
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); |
166 |
+ |
167 |
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); |
168 |
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); |
169 |
+ // there is exactly one frame |
170 |
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); |
171 |
+ |
172 |
+ sal_uInt16 nMode = pWrtShell->GetRedlineMode(); |
173 |
+ CPPUNIT_ASSERT(nMode & nsRedlineMode_t::REDLINE_SHOW_DELETE); |
174 |
+ |
175 |
+ // hide delete redlines |
176 |
+ pWrtShell->SetRedlineMode(nMode & ~nsRedlineMode_t::REDLINE_SHOW_DELETE); |
177 |
+ |
178 |
+ // there is still exactly one frame |
179 |
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); |
180 |
+ |
181 |
+ pWrtShell->SetRedlineMode(nMode); // show again |
182 |
+ |
183 |
+ // there is still exactly one frame |
184 |
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); |
185 |
+} |
186 |
+ |
187 |
void SwUiWriterTest::testFdo75110() |
188 |
{ |
189 |
SwDoc* pDoc = createDoc("fdo75110.odt"); |
190 |
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx |
191 |
index cd25464..ef476e0 100644 |
192 |
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx |
193 |
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx |
194 |
@@ -1585,7 +1585,7 @@ DocumentContentOperationsManager::CopyRange( SwPaM& rPam, SwPosition& rPos, cons |
195 |
bool bColumnSel = pDoc->IsClipBoard() && pDoc->IsColumnSelection(); |
196 |
|
197 |
// Catch if there's no copy to do |
198 |
- if( !rPam.HasMark() || ( *pStt > *pEnd && !bColumnSel ) ) |
199 |
+ if( !rPam.HasMark() || ( *pStt >= *pEnd && !bColumnSel ) ) |
200 |
return false; |
201 |
|
202 |
// Prevent copying in Flys that are anchored in the area |
203 |
@@ -3110,8 +3110,7 @@ void DocumentContentOperationsManager::CopyWithFlyInFly( |
204 |
const SwPaM* pCopiedPaM, |
205 |
const bool bMakeNewFrms, |
206 |
const bool bDelRedlines, |
207 |
- const bool bCopyFlyAtFly, |
208 |
- const bool bMergedFirstNode ) const |
209 |
+ const bool bCopyFlyAtFly ) const |
210 |
{ |
211 |
SwDoc* pDest = rInsPos.GetNode().GetDoc(); |
212 |
|
213 |
@@ -3119,17 +3118,13 @@ void DocumentContentOperationsManager::CopyWithFlyInFly( |
214 |
|
215 |
SwNodeIndex aSavePos( rInsPos, -1 ); |
216 |
bool bEndIsEqualEndPos = rInsPos == rRg.aEnd; |
217 |
- SwNodeRange aRg( rRg ); |
218 |
- if ( bMergedFirstNode ) |
219 |
- aRg.aStart++; |
220 |
- if ( aRg.aStart <= aRg.aEnd ) |
221 |
- m_rDoc.GetNodes()._CopyNodes( aRg, rInsPos, bMakeNewFrms, true ); |
222 |
- if ( !bMergedFirstNode ) |
223 |
- ++aSavePos; |
224 |
- if ( bEndIsEqualEndPos ) |
225 |
+ m_rDoc.GetNodes()._CopyNodes( rRg, rInsPos, bMakeNewFrms, true ); |
226 |
+ ++aSavePos; |
227 |
+ if( bEndIsEqualEndPos ) |
228 |
((SwNodeIndex&)rRg.aEnd) = aSavePos; |
229 |
|
230 |
aRedlRest.Restore(); |
231 |
+ |
232 |
#if OSL_DEBUG_LEVEL > 0 |
233 |
{ |
234 |
//JP 17.06.99: Bug 66973 - check count only if the selection is in |
235 |
@@ -3143,9 +3138,9 @@ void DocumentContentOperationsManager::CopyWithFlyInFly( |
236 |
!aTmpI.GetNode().IsEndNode() ) |
237 |
{ |
238 |
// If the range starts with a SwStartNode, it isn't copied |
239 |
- sal_uInt16 offset = (aRg.aStart.GetNode().GetNodeType() != ND_STARTNODE) ? 1 : 0; |
240 |
+ sal_uInt16 offset = (rRg.aStart.GetNode().GetNodeType() != ND_STARTNODE) ? 1 : 0; |
241 |
OSL_ENSURE( rInsPos.GetIndex() - aSavePos.GetIndex() == |
242 |
- aRg.aEnd.GetIndex() - aRg.aStart.GetIndex() - 1 + offset, |
243 |
+ rRg.aEnd.GetIndex() - rRg.aStart.GetIndex() - 1 + offset, |
244 |
"An insufficient number of nodes were copied!" ); |
245 |
} |
246 |
} |
247 |
@@ -3153,7 +3148,7 @@ void DocumentContentOperationsManager::CopyWithFlyInFly( |
248 |
|
249 |
{ |
250 |
::sw::UndoGuard const undoGuard(pDest->GetIDocumentUndoRedo()); |
251 |
- CopyFlyInFlyImpl( rRg, nEndContentIndex, aSavePos, bCopyFlyAtFly, bMergedFirstNode ); |
252 |
+ CopyFlyInFlyImpl( rRg, nEndContentIndex, aSavePos, bCopyFlyAtFly ); |
253 |
} |
254 |
|
255 |
SwNodeRange aCpyRange( aSavePos, rInsPos ); |
256 |
@@ -3179,8 +3174,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( |
257 |
const SwNodeRange& rRg, |
258 |
const sal_Int32 nEndContentIndex, |
259 |
const SwNodeIndex& rStartIdx, |
260 |
- const bool bCopyFlyAtFly, |
261 |
- const bool bMergedFirstNode ) const |
262 |
+ const bool bCopyFlyAtFly ) const |
263 |
{ |
264 |
// First collect all Flys, sort them according to their ordering number, |
265 |
// and then only copy them. This maintains the ordering numbers (which are only |
266 |
@@ -3301,9 +3295,6 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( |
267 |
|
268 |
++aIdx; |
269 |
} |
270 |
- if ( bMergedFirstNode ) |
271 |
- nAnchorTxtNdNumInRange--; |
272 |
- |
273 |
if ( !bAnchorTxtNdFound ) |
274 |
{ |
275 |
// This case can *not* happen, but to be robust take the first |
276 |
@@ -4072,7 +4063,7 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos, |
277 |
SwPosition* pEnd = rPam.End(); |
278 |
|
279 |
// Catch when there's no copy to do. |
280 |
- if( !rPam.HasMark() || ( *pStt > *pEnd && !bColumnSel ) || |
281 |
+ if( !rPam.HasMark() || ( *pStt >= *pEnd && !bColumnSel ) || |
282 |
//JP 29.6.2001: 88963 - dont copy if inspos is in region of start to end |
283 |
//JP 15.11.2001: don't test inclusive the end, ever exclusive |
284 |
( pDoc == &m_rDoc && *pStt <= rPos && rPos < *pEnd )) |
285 |
@@ -4160,8 +4151,6 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos, |
286 |
pNumRuleToPropagate = 0; |
287 |
} |
288 |
|
289 |
- bool bHandledStartNode = false; |
290 |
- |
291 |
// This do/while block is only there so that we can break out of it! |
292 |
do { |
293 |
if( pSttTxtNd ) |
294 |
@@ -4169,8 +4158,6 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos, |
295 |
// Don't copy the beginning completely? |
296 |
if( !bCopyCollFmt || bColumnSel || pStt->nContent.GetIndex() ) |
297 |
{ |
298 |
- bHandledStartNode = true; |
299 |
- |
300 |
SwIndex aDestIdx( rPos.nContent ); |
301 |
bool bCopyOk = false; |
302 |
if( !pDestTxtNd ) |
303 |
@@ -4246,11 +4233,18 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos, |
304 |
pEnd->nContent -= nCpyLen; |
305 |
} |
306 |
|
307 |
- if( bCopyCollFmt && bOneNode ) |
308 |
+ if( bOneNode ) |
309 |
{ |
310 |
- pSttTxtNd->CopyCollFmt( *pDestTxtNd ); |
311 |
- POP_NUMRULE_STATE |
312 |
+ if( bCopyCollFmt ) |
313 |
+ { |
314 |
+ pSttTxtNd->CopyCollFmt( *pDestTxtNd ); |
315 |
+ POP_NUMRULE_STATE |
316 |
+ } |
317 |
+ |
318 |
+ break; |
319 |
} |
320 |
+ |
321 |
+ aRg.aStart++; |
322 |
} |
323 |
} |
324 |
else if( pDestTxtNd ) |
325 |
@@ -4307,7 +4301,7 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos, |
326 |
} |
327 |
|
328 |
pDestTxtNd = aInsPos.GetNode().GetTxtNode(); |
329 |
- if( pEndTxtNd && (!bOneNode || !bHandledStartNode) ) |
330 |
+ if( pEndTxtNd ) |
331 |
{ |
332 |
SwIndex aDestIdx( rPos.nContent ); |
333 |
if( !pDestTxtNd ) |
334 |
@@ -4351,7 +4345,7 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos, |
335 |
if( bCopyAll || aRg.aStart != aRg.aEnd ) |
336 |
{ |
337 |
SfxItemSet aBrkSet( pDoc->GetAttrPool(), aBreakSetRange ); |
338 |
- if( !bOneNode && pSttTxtNd && bCopyCollFmt && pDestTxtNd->HasSwAttrSet() ) |
339 |
+ if( pSttTxtNd && bCopyCollFmt && pDestTxtNd->HasSwAttrSet() ) |
340 |
{ |
341 |
aBrkSet.Put( *pDestTxtNd->GetpSwAttrSet() ); |
342 |
if( SfxItemState::SET == aBrkSet.GetItemState( RES_BREAK, false ) ) |
343 |
@@ -4363,15 +4357,13 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos, |
344 |
if( aInsPos == pEnd->nNode ) |
345 |
{ |
346 |
SwNodeIndex aSaveIdx( aInsPos, -1 ); |
347 |
- CopyWithFlyInFly( aRg, 0, aInsPos, &rPam, bMakeNewFrms, |
348 |
- false, false, bHandledStartNode ); |
349 |
+ CopyWithFlyInFly( aRg, 0,aInsPos, &rPam, bMakeNewFrms, false ); |
350 |
++aSaveIdx; |
351 |
pEnd->nNode = aSaveIdx; |
352 |
pEnd->nContent.Assign( aSaveIdx.GetNode().GetTxtNode(), 0 ); |
353 |
} |
354 |
else |
355 |
- CopyWithFlyInFly( aRg, pEnd->nContent.GetIndex(), aInsPos, &rPam, |
356 |
- bMakeNewFrms, false, false, bHandledStartNode ); |
357 |
+ CopyWithFlyInFly( aRg, pEnd->nContent.GetIndex(), aInsPos, &rPam, bMakeNewFrms, false ); |
358 |
|
359 |
bCopyBookmarks = false; |
360 |
|
361 |
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx |
362 |
index eac9cc5..c285f35 100644 |
363 |
--- a/sw/source/core/doc/docnew.cxx |
364 |
+++ b/sw/source/core/doc/docnew.cxx |
365 |
@@ -935,6 +935,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu |
366 |
SwPageDesc *const pTargetPageDesc, bool const bDeletePrevious, int pageOffset) |
367 |
{ |
368 |
// GetEndOfExtras + 1 = StartOfContent == no content node! |
369 |
+ // this ensures, that we have at least two nodes in the SwPaM. |
370 |
// @see IDocumentContentOperations::CopyRange |
371 |
SwNodeIndex aSourceIdx( rSource.GetNodes().GetEndOfExtras(), 1 ); |
372 |
SwNodeIndex aSourceEndIdx( rSource.GetNodes().GetEndOfContent(), -1 ); |
373 |
diff --git a/sw/source/core/inc/DocumentContentOperationsManager.hxx b/sw/source/core/inc/DocumentContentOperationsManager.hxx |
374 |
index adf7498..7ae23f6 100644 |
375 |
--- a/sw/source/core/inc/DocumentContentOperationsManager.hxx |
376 |
+++ b/sw/source/core/inc/DocumentContentOperationsManager.hxx |
377 |
@@ -106,13 +106,11 @@ public: |
378 |
const SwPaM* pCopiedPaM = NULL, |
379 |
bool bMakeNewFrms = true, |
380 |
bool bDelRedlines = true, |
381 |
- bool bCopyFlyAtFly = false, |
382 |
- const bool bMergedFirstNode = false ) const; |
383 |
+ bool bCopyFlyAtFly = false ) const; |
384 |
void CopyFlyInFlyImpl( const SwNodeRange& rRg, |
385 |
const sal_Int32 nEndContentIndex, |
386 |
const SwNodeIndex& rStartIdx, |
387 |
- const bool bCopyFlyAtFly = false, |
388 |
- const bool bMergedFirstNode = false ) const; |
389 |
+ const bool bCopyFlyAtFly = false ) const; |
390 |
|
391 |
/// Parameters for _Rst and lcl_SetTxtFmtColl |
392 |
//originallyfrom docfmt.cxx |
393 |
-- |
394 |
2.4.0 |
395 |
|