Commit Graph

7 Commits

Author SHA1 Message Date
Veniamin Albaev 35426ed5dc Tests refactoring
Primary motivation: Avoid statefull tests with not ignorable git file tree changes.
Multiple tests reads and overwrites signle file for won needs.
Multiple tests reads and overwrites file under version control.

Secondary motivation: Minimal tests logic aligment, separate error expectation
and not error expectation tests. Introduce sub-test over test data sets and so far.

This commit is not ideal but necessary (IMHO)
2018-12-27 13:51:44 +03:00
xuri 90221bd98f
Fixes #310, support set and get TopLeftCell properties of sheet view options 2018-12-18 21:50:07 +08:00
OloloevReal b8464af086 Added ZoomScale SheetViewOption
Accessible value between 10 - 400

Used as:
xlsx.SetSheetViewOptions(sheet, 0, excelize.ZoomScale(75))
2018-04-16 14:01:10 +03:00
Ri Xu 6d634ca320
GitHub repo URL changed. 2017-12-01 16:52:15 +08:00
Ri Xu 07a4140098
- 24 hour time format supported, relate issue #163;
- godoc and go test updated
2017-12-01 15:47:39 +08:00
Olivier Mengué d2fb0197ab SheetViewOptionPtr: document that it is a superset of SheetViewOption
Document in type system (not just in text for humans) that
all SheetViewOptionPtr are also SheetViewOption (well, if not nil).
This improves documentation visible with godoc but this simple change
also allows more flexibility to manipulate SheetViewOption programatically
such as saving and restoring values:

	var opt excelize.ShowFormulas
	opt = new(excelize.ShowFormulas)
	_ = xl.GetSheetViewOptions(sheet, -1, opt)
	_ = xl.SetSheetViewOptions(sheet, -1, opt)
2017-11-17 19:43:32 +01:00
Olivier Mengué 88e48e079a Add SetSheetViewOptions and GetSheetViewOptions (#145)
Two new methods:
- SetSheetViewOptions(sheetName string, viewIndex int, opts ...SheetViewOption) error
- GetSheetViewOptions(sheetName string, viewIndex int, opts ...SheetViewOptionPtr) error

The option values are given by the user through types that have privates methods
that implement the private SheetViewOption and SheetViewOptionPtr interfaces:
- DefaultGridColor(bool)
- RightToLeft(bool)
- ShowFormulas(bool)
- ShowGridLines(bool)
- ShowRowColHeaders(bool)

Examples:
    err := xl.SetSheetViewOptions("Sheet1", -1, excelize.ShowGridLines(true))

    var showGridLines excelize.ShowGridLines
    err := xl.GetSheetViewOptions("Sheet1", -1, &showGridLines)

Fixes #145.
2017-11-16 12:00:36 +01:00