Lines 44-49
Link Here
|
44 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet; |
44 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet; |
45 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetFormatPr; |
45 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetFormatPr; |
46 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetPr; |
46 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetPr; |
|
|
47 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetProtection; |
47 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetView; |
48 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetView; |
48 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetViews; |
49 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetViews; |
49 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet; |
50 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet; |
Lines 337-343
Link Here
|
337 |
} |
338 |
} |
338 |
|
339 |
|
339 |
public short getLeftCol() { |
340 |
public short getLeftCol() { |
340 |
// TODO no test for this method at the moment. |
|
|
341 |
String cellRef = worksheet.getSheetViews().getSheetViewArray(0).getTopLeftCell(); |
341 |
String cellRef = worksheet.getSheetViews().getSheetViewArray(0).getTopLeftCell(); |
342 |
CellReference cellReference = new CellReference(cellRef); |
342 |
CellReference cellReference = new CellReference(cellRef); |
343 |
return cellReference.getCol(); |
343 |
return cellReference.getCol(); |
Lines 457-476
Link Here
|
457 |
} |
457 |
} |
458 |
|
458 |
|
459 |
public boolean getScenarioProtect() { |
459 |
public boolean getScenarioProtect() { |
460 |
// TODO Auto-generated method stub |
460 |
return getSheetTypeProtection().getScenarios(); |
461 |
return false; |
|
|
462 |
} |
461 |
} |
463 |
|
462 |
|
|
|
463 |
protected CTSheetProtection getSheetTypeProtection() { |
464 |
if (worksheet.getSheetProtection() == null) { |
465 |
worksheet.setSheetProtection(CTSheetProtection.Factory.newInstance()); |
466 |
} |
467 |
return worksheet.getSheetProtection(); |
468 |
} |
469 |
|
464 |
public short getTopRow() { |
470 |
public short getTopRow() { |
465 |
// TODO no test for this method at the moment. |
471 |
String cellRef = getSheetTypeSheetView().getTopLeftCell(); |
466 |
String cellRef = worksheet.getSheetViews().getSheetViewArray(0).getTopLeftCell(); |
|
|
467 |
CellReference cellReference = new CellReference(cellRef); |
472 |
CellReference cellReference = new CellReference(cellRef); |
468 |
return (short) cellReference.getRow(); |
473 |
return (short) cellReference.getRow(); |
469 |
} |
474 |
} |
470 |
|
475 |
|
|
|
476 |
// Right signature method. Remove the wrong one when it will be removed in HSSFSheet (and interface) |
477 |
public boolean getVerticallyCenter() { |
478 |
return getVerticallyCenter(true); |
479 |
} |
480 |
|
471 |
public boolean getVerticallyCenter(boolean value) { |
481 |
public boolean getVerticallyCenter(boolean value) { |
472 |
// TODO Auto-generated method stub |
482 |
return getSheetTypePrintOptions().getVerticalCentered(); |
473 |
return false; |
|
|
474 |
} |
483 |
} |
475 |
|
484 |
|
476 |
public void groupColumn(short fromColumn, short toColumn) { |
485 |
public void groupColumn(short fromColumn, short toColumn) { |
Lines 726-744
Link Here
|
726 |
|
735 |
|
727 |
} |
736 |
} |
728 |
|
737 |
|
729 |
public void setSelected(boolean sel) { |
738 |
public void setVerticallyCenter(boolean value) { |
730 |
// TODO Auto-generated method stub |
739 |
getSheetTypePrintOptions().setVerticalCentered(value); |
|
|
740 |
} |
731 |
|
741 |
|
|
|
742 |
// HSSFSheet compatibility methods. See also the following zoom related methods |
743 |
public void setZoom(int numerator, int denominator) { |
744 |
setZoom((numerator/denominator) * 100); |
732 |
} |
745 |
} |
733 |
|
746 |
|
734 |
public void setVerticallyCenter(boolean value) { |
747 |
public void setZoom(long scale) { |
735 |
// TODO Auto-generated method stub |
748 |
getSheetTypeSheetView().setZoomScale(scale); |
|
|
749 |
} |
736 |
|
750 |
|
|
|
751 |
public void setZoomNormal(long scale) { |
752 |
getSheetTypeSheetView().setZoomScaleNormal(scale); |
737 |
} |
753 |
} |
738 |
|
754 |
|
739 |
public void setZoom(int numerator, int denominator) { |
755 |
public void setZoomPageLayoutView(long scale) { |
740 |
// TODO Auto-generated method stub |
756 |
getSheetTypeSheetView().setZoomScalePageLayoutView(scale); |
|
|
757 |
} |
741 |
|
758 |
|
|
|
759 |
public void setZoomSheetLayoutView(long scale) { |
760 |
getSheetTypeSheetView().setZoomScaleSheetLayoutView(scale); |
742 |
} |
761 |
} |
743 |
|
762 |
|
744 |
public void shiftRows(int startRow, int endRow, int n) { |
763 |
public void shiftRows(int startRow, int endRow, int n) { |
Lines 752-759
Link Here
|
752 |
} |
771 |
} |
753 |
|
772 |
|
754 |
public void showInPane(short toprow, short leftcol) { |
773 |
public void showInPane(short toprow, short leftcol) { |
755 |
// TODO Auto-generated method stub |
774 |
CellReference cellReference = new CellReference(); |
756 |
|
775 |
String cellRef = cellReference.convertRowColToString(toprow, leftcol); |
|
|
776 |
getSheetTypeSheetView().setTopLeftCell(cellRef); |
757 |
} |
777 |
} |
758 |
|
778 |
|
759 |
public void ungroupColumn(short fromColumn, short toColumn) { |
779 |
public void ungroupColumn(short fromColumn, short toColumn) { |
Lines 766-772
Link Here
|
766 |
|
786 |
|
767 |
} |
787 |
} |
768 |
|
788 |
|
769 |
public void setTabSelected(boolean flag) { |
789 |
public void setSelected(boolean flag) { |
770 |
CTSheetViews views = getSheetTypeSheetViews(); |
790 |
CTSheetViews views = getSheetTypeSheetViews(); |
771 |
for (CTSheetView view : views.getSheetViewArray()) { |
791 |
for (CTSheetView view : views.getSheetViewArray()) { |
772 |
view.setTabSelected(flag); |
792 |
view.setTabSelected(flag); |
Lines 781-787
Link Here
|
781 |
return worksheet.getSheetViews(); |
801 |
return worksheet.getSheetViews(); |
782 |
} |
802 |
} |
783 |
|
803 |
|
784 |
public boolean isTabSelected() { |
804 |
public boolean isSelected() { |
785 |
CTSheetView view = getDefaultSheetView(); |
805 |
CTSheetView view = getDefaultSheetView(); |
786 |
return view != null && view.getTabSelected(); |
806 |
return view != null && view.getTabSelected(); |
787 |
} |
807 |
} |