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
This commit is contained in:
Jason Height 2006-08-28 03:39:13 +00:00
parent d636083355
commit bde0ed706b
1 changed files with 7 additions and 1 deletions

View File

@ -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());