Difference between revisions of "Documentation/DevGuide/Spreadsheets/Indentation"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (FINAL VERSION FOR L10N)
 
(One intermediate revision by one other user not shown)
Line 15: Line 15:
 
The following sample shows how to increase the cell indentation by 1.  
 
The following sample shows how to increase the cell indentation by 1.  
 
<!--[SOURCE:Spreadsheet/SpreadsheetSample.java]-->
 
<!--[SOURCE:Spreadsheet/SpreadsheetSample.java]-->
 
+
<syntaxhighlight lang="java">
 
   // --- Change indentation. ---
 
   // --- Change indentation. ---
 
   com.sun.star.util.XIndent xIndent = (com.sun.star.util.XIndent)
 
   com.sun.star.util.XIndent xIndent = (com.sun.star.util.XIndent)
 
       UnoRuntime.queryInterface(com.sun.star.util.XIndent.class, xCellRange);
 
       UnoRuntime.queryInterface(com.sun.star.util.XIndent.class, xCellRange);
 
   xIndent.incrementIndent();  
 
   xIndent.incrementIndent();  
 
+
</syntaxhighlight>
{{Documentation/Caution|Due to a bug, this interface does not work in the current implementation. Workaround: Use the paragraph property <tt>ParaIndent</tt>.}}
+
{{Warn|Due to a bug, this interface does not work in the current implementation. Workaround: Use the paragraph property <tt>ParaIndent</tt>.}}
  
 
{{PDL1}}
 
{{PDL1}}
  
 
[[Category:Documentation/Developer's Guide/Spreadsheet Documents]]
 
[[Category:Documentation/Developer's Guide/Spreadsheet Documents]]

Latest revision as of 15:38, 3 January 2021



The methods of the interface com.sun.star.util.XIndent change the left indentation of the cell contents. This interface is supported by cells, cell ranges and collections of cell ranges. The indentation is incremental and decremental, independent for each cell.

  • The method decrementIndent() reduces the indentation of each cell by 1.
  • The method incrementIndent() enlarges the indentation of each cell by 1.

The following sample shows how to increase the cell indentation by 1.

  // --- Change indentation. ---
  com.sun.star.util.XIndent xIndent = (com.sun.star.util.XIndent)
      UnoRuntime.queryInterface(com.sun.star.util.XIndent.class, xCellRange);
  xIndent.incrementIndent();
Documentation caution.png Due to a bug, this interface does not work in the current implementation. Workaround: Use the paragraph property ParaIndent.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages