Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: 3.8.1
    • Fix Version/s: 3.8.3
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      requirement

      When traversing cells, users want to know how large a merged cell is to move to next cell aside by it.

      workaround

      Sheet sheet = spreadsheet.getSelectedSheet();
      CellRegion region = sheet.getInternalSheet().getMergedRegion(row, col);
      

        Activity

        Hide
        henrichen henrichen added a comment - - edited
        	/**
        	 * Returns the merged region of the left top cell of this Range if any; 
        	 * otherwise, returns null if not a merged region.
        	 * @return
        	 */
        	public CellRegion getMergedRegion();
        
        // Assume there is a merged region A1:B2
        Range A1 = Ranges.range(sheet, "A1");
        CellRegion region = A1.getMergedRegion(); // A1:B2
        
        Range B1 = Ranges.range(sheet, "B1");
        CellRegion region2 = B1.getMergedRegion(); //A1:B2
        
        Range C1 = Ranges.range(sheet, "C1");
        CellRegion region3 = B1.getMergedRegion(); // null
        
        Show
        henrichen henrichen added a comment - - edited /** * Returns the merged region of the left top cell of this Range if any; * otherwise, returns null if not a merged region. * @ return */ public CellRegion getMergedRegion(); // Assume there is a merged region A1:B2 Range A1 = Ranges.range(sheet, "A1" ); CellRegion region = A1.getMergedRegion(); // A1:B2 Range B1 = Ranges.range(sheet, "B1" ); CellRegion region2 = B1.getMergedRegion(); //A1:B2 Range C1 = Ranges.range(sheet, "C1" ); CellRegion region3 = B1.getMergedRegion(); // null
        Hide
        henrichen henrichen added a comment -

        Done.

        Show
        henrichen henrichen added a comment - Done.

          People

          • Assignee:
            henrichen henrichen
            Reporter:
            hawk hawk
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: