From: Jason Height Date: Mon, 28 Aug 2006 03:39:13 +0000 (+0000) Subject: Bug36646: Ret3dPtg to include quotes when sheetname contains a space. X-Git-Tag: REL_3_0_ALPHA3~42 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4db9e619040b285efdb5dfd091decd47d8f07b47;p=poi.git Bug36646: Ret3dPtg to include quotes when sheetname contains a space. git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@437519 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java b/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java index a603816550..25e1a8f345 100644 --- a/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java +++ b/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java @@ -160,7 +160,13 @@ public class Ref3DPtg extends Ptg { StringBuffer retval = new StringBuffer(); SheetReferences refs = book == null ? null : book.getSheetReferences(); if (refs != null) { - retval.append(refs.getSheetName((int)this.field_1_index_extern_sheet)); + String sheetName =refs.getSheetName((int)this.field_1_index_extern_sheet); + boolean appendQuotes = sheetName.contains(" "); + if (appendQuotes) + retval.append("'"); + retval.append(sheetName); + if (appendQuotes) + retval.append("'"); retval.append('!'); } retval.append((new CellReference(getRow(),getColumn(),!isRowRelative(),!isColRelative())).toString());