---
Product: Aspose.Cells
Platform: cpp
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/cpp/stylesheetsavecontext
---

# StylesheetSaveContext

## Overview

`StylesheetSaveContext` is a class in Aspose.Cells FOSS for C++.

Internal context used during stylesheet saving to hold the built stylesheet document together with style index maps and format counts.

This class declares 6 methods for StylesheetSaveContext objects in C++ programs.
Available methods include: `GetDifferentialFormatCount`, `GetDifferentialStyleIndex`, `GetDocument`, `GetHasStyles`, `GetStyleIndex`, `XmlDocument`.
Public members are accessible to any C++ application after installing the Aspose.Cells FOSS for C++ package.
Accessor methods: `XmlDocument`.

## Accessor Methods

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `XmlDocument` | `XmlDocument` | Read | Gets the xml document. |

## Methods

| Signature | Description |
|-----------|-------------|
| `XmlDocument()` → `XmlDocument` | Gets the built stylesheet XML document. |
| `GetDocument()` → `XmlDocument` | Gets the built stylesheet XML document. |
| `GetDifferentialFormatCount()` → `int` | Gets the differential format count. |
| `GetHasStyles()` → `bool` | Gets a value indicating whether the workbook has any non-default styles. |
| `GetStyleIndex(record: Core::CellRecord)` → `int` | Gets the cell format index for the given cell record. Returns 0 if the style is not found. |
| `GetDifferentialStyleIndex(condition: Core::FormatConditionModel)` → `std::optional<int>` | Gets the differential style index for the given format condition. Returns nullopt if the style is default or not found. |

## See Also

- [Aspose.Cells — Enterprise API Reference](https://reference.aspose.com/cells/)