ContextHandlerRef TextContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{ // this context handler is used for <c:tx> and embedded <c:v> elements if( isCurrentElement( C_TOKEN( tx ) ) || isCurrentElement(CX_TOKEN(tx)) ) switch( nElement )
{ case C_TOKEN( rich ): case CX_TOKEN( rich ): returnnew TextBodyContext( *this, mrModel.mxTextBody.create() );
case C_TOKEN( strRef ):
OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" ); returnnew StringSequenceContext( *this, mrModel.mxDataSeq.create() );
case C_TOKEN( v ): case CX_TOKEN( v ):
OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" ); returnthis; // collect value in onCharacters() case CX_TOKEN( txData ): // CT_TextData can have a <cx:v> element or a sequence // <cx:f> <cx:v>. The former case will be handled through the // CX_TOKEN(v) above, but the latter is not handled. TODO returnthis;
} return nullptr;
}
void TextContext::onCharacters( const OUString& rChars )
{ if( isCurrentElement( C_TOKEN( v ) ) )
{ // Static text is stored as a single string formula token for Excel document.
mrModel.mxDataSeq.create().maFormula = "\"" + rChars + "\"";
// Also store it as a single element type for non-Excel document.
mrModel.mxDataSeq->maData[0] <<= rChars;
mrModel.mxDataSeq->mnPointCount = 1;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.