public NameRecord cloneFilter(int filterDbNameIndex, int newSheetIndex){NameRecord origNameRecord = getNameRecord(filterDbNameIndex);int newExtSheetIx = checkExternSheet(newSheetIndex);Ptg[] ptgs = origNameRecord.getNameDefinition();for (int i=0; i< ptgs.length; i++) {Ptg ptg = ptgs[i];if (ptg instanceof Area3DPtg) {Area3DPtg a3p = (Area3DPtg) ((OperandPtg) ptg).copy();a3p.setExternSheetIndex(newExtSheetIx);ptgs[i] = a3p;} else if (ptg instanceof Ref3DPtg) {Ref3DPtg r3p = (Ref3DPtg) ((OperandPtg) ptg).copy();r3p.setExternSheetIndex(newExtSheetIx);ptgs[i] = r3p;}}NameRecord newNameRecord = createBuiltInName(NameRecord.BUILTIN_FILTER_DB, newSheetIndex+1);newNameRecord.setNameDefinition(ptgs);newNameRecord.setHidden(true);return newNameRecord;}
public NameRecord CloneFilter(int filterDbNameIndex, int newSheetIndex){NameRecord origNameRecord = GetNameRecord(filterDbNameIndex);int newExtSheetIx = CheckExternSheet(newSheetIndex);Ptg[] ptgs = origNameRecord.NameDefinition;for (int i = 0; i < ptgs.Length; i++){Ptg ptg = ptgs[i];if (ptg is Area3DPtg){Area3DPtg a3p = (Area3DPtg)((OperandPtg)ptg).Copy();a3p.ExternSheetIndex = (newExtSheetIx);ptgs[i] = a3p;}else if (ptg is Ref3DPtg){Ref3DPtg r3p = (Ref3DPtg)((OperandPtg)ptg).Copy();r3p.ExternSheetIndex = (newExtSheetIx);ptgs[i] = r3p;}}NameRecord newNameRecord = CreateBuiltInName(NameRecord.BUILTIN_FILTER_DB, newSheetIndex + 1);newNameRecord.NameDefinition = ptgs;newNameRecord.IsHiddenName = true;return newNameRecord;}