Package org.openxmlformats.schemas.spreadsheetml.x2006.main

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRst.xgetT()


        for (Iterator<Integer> it = formats.keySet().iterator(); it.hasNext();) {
            int runEndIdx = it.next();
            CTRElt run = st.addNewR();
            String fragment = text.substring(runStartIdx, runEndIdx);
            run.setT(fragment);
            preserveSpaces(run.xgetT());
            CTRPrElt fmt = formats.get(runEndIdx);
            if(fmt != null) run.setRPr(fmt);
            runStartIdx = runEndIdx;
        }
        return st;
View Full Code Here


                CTRElt c = (CTRElt)r[i].copy();
                txt = text.substring(rStart, rEnd);
                c.setT(txt);
                runs.add(c);
                pos += txt.length();
                preserveSpaces(c.xgetT());
            }
        }


        st.setRArray(runs.toArray(new CTRElt[runs.size()]));
View Full Code Here

        for (Iterator<Integer> it = formats.keySet().iterator(); it.hasNext();) {
            int runEndIdx = it.next();
            CTRElt run = st.addNewR();
            String fragment = text.substring(runStartIdx, runEndIdx);
            run.setT(fragment);
            preserveSpaces(run.xgetT());
            CTRPrElt fmt = formats.get(runEndIdx);
            if(fmt != null) run.setRPr(fmt);
            runStartIdx = runEndIdx;
        }
        return st;
View Full Code Here

                CTRElt c = (CTRElt)r[i].copy();
                txt = text.substring(rStart, rEnd);
                c.setT(txt);
                runs.add(c);
                pos += txt.length();
                preserveSpaces(c.xgetT());
            }
        }


        st.setRArray(runs.toArray(new CTRElt[runs.size()]));
View Full Code Here

        for (Iterator<Integer> it = formats.keySet().iterator(); it.hasNext();) {
            int runEndIdx = it.next();
            CTRElt run = st.addNewR();
            String fragment = text.substring(runStartIdx, runEndIdx);
            run.setT(fragment);
            preserveSpaces(run.xgetT());
            CTRPrElt fmt = formats.get(runEndIdx);
            if(fmt != null) run.setRPr(fmt);
            runStartIdx = runEndIdx;
        }
        return st;
View Full Code Here

    public void append(String text, XSSFFont font){
        if(st.sizeOfRArray() == 0 && st.isSetT()) {
            //convert <t>string</t> into a text run: <r><t>string</t></r>
            CTRElt lt = st.addNewR();
            lt.setT(st.getT());
            preserveSpaces(lt.xgetT());
            st.unsetT();
        }
        CTRElt lt = st.addNewR();
        lt.setT(text);
        preserveSpaces(lt.xgetT());
View Full Code Here

            preserveSpaces(lt.xgetT());
            st.unsetT();
        }
        CTRElt lt = st.addNewR();
        lt.setT(text);
        preserveSpaces(lt.xgetT());
        CTRPrElt pr = lt.addNewRPr();
        if(font != null) setRunAttributes(font.getCTFont(), pr);
    }

    /**
 
View Full Code Here

        for (Iterator<Integer> it = formats.keySet().iterator(); it.hasNext();) {
            int runEndIdx = it.next();
            CTRElt run = st.addNewR();
            String fragment = text.substring(runStartIdx, runEndIdx);
            run.setT(fragment);
            preserveSpaces(run.xgetT());
            CTRPrElt fmt = formats.get(runEndIdx);
            if(fmt != null) run.setRPr(fmt);
            runStartIdx = runEndIdx;
        }
        return st;
View Full Code Here

     * if a string has leading or trailing white spaces
     */
    public void testPreserveSpaces() {
        XSSFRichTextString rt = new XSSFRichTextString("Apache");
        CTRst ct = rt.getCTRst();
        STXstring xs = ct.xgetT();
        assertEquals("<xml-fragment>Apache</xml-fragment>", xs.xmlText());
        rt.setString("  Apache");
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", xs.xmlText());

    }
View Full Code Here

     * if a string has leading or trailing white spaces
     */
    public void testPreserveSpaces() {
        XSSFRichTextString rt = new XSSFRichTextString("Apache");
        CTRst ct = rt.getCTRst();
        STXstring xs = ct.xgetT();
        assertEquals("<xml-fragment>Apache</xml-fragment>", xs.xmlText());
        rt.setString("  Apache");
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", xs.xmlText());

    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.