Skip to content

Commit 9d1e7f3

Browse files
david-allisonmikehardy
authored andcommitted
refactor: remove 'getFieldsAsBundleForPreview'
1 parent aceb74f commit 9d1e7f3

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/NoteService.kt

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919

2020
package com.ichi2.anki.servicelayer
2121

22-
import android.os.Bundle
23-
import androidx.annotation.CheckResult
24-
import androidx.annotation.VisibleForTesting
2522
import com.ichi2.anki.CollectionManager.withCol
2623
import com.ichi2.anki.FieldEditText
2724
import com.ichi2.anki.libanki.Card
@@ -149,31 +146,6 @@ object NoteService {
149146
field.mediaFile = outFile
150147
}
151148

152-
/**
153-
* @param replaceNewlines Converts [FieldEditText.NEW_LINE] to HTML linebreaks
154-
*/
155-
@VisibleForTesting
156-
@CheckResult
157-
fun getFieldsAsBundleForPreview(
158-
editFields: List<NoteField?>?,
159-
replaceNewlines: Boolean,
160-
): Bundle {
161-
val fields = Bundle()
162-
// Save the content of all the note fields. We use the field's ord as the key to
163-
// easily map the fields correctly later.
164-
if (editFields == null) {
165-
return fields
166-
}
167-
for (e in editFields) {
168-
if (e?.fieldText == null) {
169-
continue
170-
}
171-
val fieldValue = convertToHtmlNewline(e.fieldText!!, replaceNewlines)
172-
fields.putString(e.ord.toString(), fieldValue)
173-
}
174-
return fields
175-
}
176-
177149
fun convertToHtmlNewline(
178150
fieldData: String,
179151
replaceNewlines: Boolean,

0 commit comments

Comments
 (0)