LibreOffice 4.3.7を使っております,ci5kymと申します。
UNO Java経由でcalcのドキュメント内の一定範囲のセル(A1:C5など)に格子線(外枠だけでなく中も引く)
を引きたいのですが,ご存知の方がおられたらご教授お願い致します。
--- やったこと ---
documentの取得などは省略します。
com.sun.star.beans.XPropertySet xPropSet = null;
com.sun.star.table.XCellRange xCellRange = null;
xCellRange = xSheet.getCellRangeByName("A1:C5");
xPropSet = UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class,
xCellRange);
com.sun.star.table.BorderLine aLine = new com.sun.star.table.BorderLine();
aLine.Color = 0x99CCFF;
aLine.InnerLineWidth = aLine.LineDistance = 0;
aLine.OuterLineWidth = 50;
com.sun.star.table.TableBorder aBorder = new
com.sun.star.table.TableBorder();
aBorder.TopLine = aBorder.BottomLine = aBorder.LeftLine =
aBorder.RightLine = aLine;
aBorder.IsTopLineValid = aBorder.IsBottomLineValid = true;
aBorder.IsLeftLineValid = aBorder.IsRightLineValid = true;
xPropSet.setPropertyValue("TableBorder", aBorder);
これだと外枠だけに引かれて,範囲の内側のセルには引かれないままです。
com.sun.star.container.XIndexAccess を使って Iterator で回しながら,個別セルごとに
com.sun.star.beans.XPropertySet経由で枠線指定すれば個別セルの周りをを引くことができるのでしょうが,
そこまで面倒な事をしなくても,コマンド一発ですむような便利な方法がないものかと調べたのですが,
見つかりませんでした。
もし,ご存知の方がおられたら,ご教授お願い致します。
--
Unsubscribe instructions: E-mail to [email protected]
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/ja/users/
All messages sent to this list will be publicly archived and cannot be deleted