Difference between revisions of "Documentation/DevGuide/Spreadsheets/Character and Paragraph Format"
From Apache OpenOffice Wiki
< Documentation | DevGuide
OOoWikiBot (Talk | contribs) m (Robot: Changing Category:Documentation/Developers Guide/Spreadsheet Documents) |
OOoWikiBot (Talk | contribs) m (FINAL VERSION FOR L10N) |
||
Line 6: | Line 6: | ||
|NextPage=Documentation/DevGuide/Spreadsheets/Indentation | |NextPage=Documentation/DevGuide/Spreadsheets/Indentation | ||
}} | }} | ||
− | {{DISPLAYTITLE:Character and Paragraph Format}} | + | {{Documentation/DevGuideLanguages|Documentation/DevGuide/Spreadsheets/{{SUBPAGENAME}}}} |
+ | {{DISPLAYTITLE:Character and Paragraph Format}} | ||
The following services of a cell range contain properties for the character style and paragraph format: | The following services of a cell range contain properties for the character style and paragraph format: | ||
Revision as of 10:26, 14 May 2009
The following services of a cell range contain properties for the character style and paragraph format:
- Service com.sun.star.style.ParagraphProperties
- Service com.sun.star.style.CharacterProperties
- Service com.sun.star.style.CharacterPropertiesAsian
- Service com.sun.star.style.CharacterPropertiesComplex
The chapter Formatting contains a description of these properties.
This example formats a given cell range xCellRange
:
// --- Change cell range properties. --- com.sun.star.beans.XPropertySet xPropSet = (com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xCellRange); // from com.sun.star.styles.CharacterProperties xPropSet.setPropertyValue("CharColor", new Integer(0x003399)); xPropSet.setPropertyValue("CharHeight", new Float(20.0)); // from com.sun.star.styles.ParagraphProperties xPropSet.setPropertyValue("ParaLeftMargin", new Integer(500)); // from com.sun.star.table.CellProperties xPropSet.setPropertyValue("IsCellBackgroundTransparent", new Boolean(false)); xPropSet.setPropertyValue("CellBackColor", new Integer(0x99CCFF));
The code below changes the character and paragraph formatting of a cell. Assume that xCell
is a com.sun.star.table.XCell interface of a spreadsheet cell.
// --- Change cell properties. --- com.sun.star.beans.XPropertySet xPropSet = (com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xCell); // from styles.CharacterProperties xPropSet.setPropertyValue("CharColor", new Integer(0x003399)); xPropSet.setPropertyValue("CharHeight", new Float(20.0)); // from styles.ParagraphProperties xPropSet.setPropertyValue("ParaLeftMargin", new Integer(500)); // from table.CellProperties xPropSet.setPropertyValue("IsCellBackgroundTransparent", new Boolean(false)); xPropSet.setPropertyValue("CellBackColor", new Integer(0x99CCFF));
Content on this page is licensed under the Public Documentation License (PDL). |