Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/src/main/java/app/opendocument/droid/background/CoreLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import app.opendocument.core.HtmlView
import app.opendocument.core.HttpServer
import app.opendocument.core.Odr
import app.opendocument.core.OdrException
import app.opendocument.core.TableDimensions
import app.opendocument.droid.nonfree.CrashManager
import java.io.File
import java.io.IOException
Expand Down Expand Up @@ -167,6 +168,11 @@ class CoreLoader(private val context: Context) {
// document. PageView.setDarkeningAllowed picks between them
htmlConfig.colorScheme = HtmlColorScheme.SYSTEM

// stated rather than inherited: a sheet past it is cut off silently
htmlConfig.spreadsheetLimit =
TableDimensions(SPREADSHEET_LIMIT_ROWS, SPREADSHEET_LIMIT_COLUMNS)
htmlConfig.spreadsheetLimitByContent = true

val cacheDirectory = File(cachePath)
cacheDirectory.deleteRecursively()
cacheDirectory.mkdirs()
Expand Down Expand Up @@ -301,6 +307,10 @@ class CoreLoader(private val context: Context) {
companion object {
private const val TAG = "CoreLoader"

/** The largest sheet region translated - every cell in it becomes a `<td>`. */
private const val SPREADSHEET_LIMIT_ROWS = 10000
private const val SPREADSHEET_LIMIT_COLUMNS = 500

/**
* The one http server of the process, started on the first [initialize] and never stopped.
*
Expand Down
Loading