]> source.dussan.org Git - poi.git/commitdiff
Bug36646: Ret3dPtg to include quotes when sheetname contains a space.
authorJason Height <jheight@apache.org>
Mon, 28 Aug 2006 03:39:13 +0000 (03:39 +0000)
committerJason Height <jheight@apache.org>
Mon, 28 Aug 2006 03:39:13 +0000 (03:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@437519 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java

index a603816550f9cdf5d06fcc400de3bedec6fcf9ad..25e1a8f34576ec1b758d173c513c9fa82afd3ce9 100644 (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());