Skip to content

Commit 23563fb

Browse files
authored
Revert "Regen paraid (#855)" (#856)
This reverts commit 78d08c6.
1 parent 78d08c6 commit 23563fb

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

docx-core/src/documents/elements/paragraph.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::documents::BuildXML;
77
use crate::types::*;
88
use crate::xml_builder::*;
99

10-
#[derive(Serialize, Debug, PartialEq)]
10+
#[derive(Serialize, Debug, Clone, PartialEq)]
1111
#[serde(rename_all = "camelCase")]
1212
pub struct Paragraph {
1313
pub id: String,
@@ -27,17 +27,6 @@ impl Default for Paragraph {
2727
}
2828
}
2929

30-
impl Clone for Paragraph {
31-
fn clone(&self) -> Self {
32-
Self {
33-
id: crate::generate_para_id(), // 新しいIDを生成してID重複を防ぐ
34-
children: self.children.clone(),
35-
property: self.property.clone(),
36-
has_numbering: self.has_numbering,
37-
}
38-
}
39-
}
40-
4130
#[derive(Debug, Clone, PartialEq)]
4231
pub enum ParagraphChild {
4332
Run(Box<Run>),

docx-core/src/documents/elements/table_of_contents.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl BuildXML for TableOfContents {
228228
TocContent::Paragraph(p) => {
229229
// Merge paragraph
230230
if i == 0 {
231-
let mut new_p = p.clone(); // cloneで自動的に新しいIDが生成される
231+
let mut new_p = p.clone();
232232
new_p.children.insert(
233233
0,
234234
ParagraphChild::Run(Box::new(

0 commit comments

Comments
 (0)