diff options
author | Noel Power <noel.power@novell.com> | 2012-08-03 13:06:25 +0100 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2012-08-03 14:25:47 +0100 |
commit | cc51389c07f880d513f94b9c4c1bad449435b406 (patch) | |
tree | 4e89018ab5ffd77618735fcf2f664c7c81ef458d /xmloff | |
parent | 42c1644f8b24d2462d747c07a75283e9cd99b415 (diff) |
support new xml number:fill-character elem for number-style namespace
Change-Id: I7d3ca1f121396dfc017bb1ee73651f9017e58ba3
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/xmlnumfe.hxx | 1 | ||||
-rw-r--r-- | xmloff/inc/xmloff/xmltoken.hxx | 1 | ||||
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfe.cxx | 16 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 10 |
5 files changed, 29 insertions, 0 deletions
diff --git a/xmloff/inc/xmloff/xmlnumfe.hxx b/xmloff/inc/xmloff/xmlnumfe.hxx index 7dcef8fb36df..d3bac9b86910 100644 --- a/xmloff/inc/xmloff/xmlnumfe.hxx +++ b/xmloff/inc/xmloff/xmlnumfe.hxx @@ -86,6 +86,7 @@ private: SAL_DLLPRIVATE void WriteMapElement_Impl( sal_Int32 nOp, double fLimit, sal_Int32 nKey, sal_Int32 nPart ); + SAL_DLLPRIVATE void WriteRepeatedElement_Impl( sal_Unicode ch ); SAL_DLLPRIVATE sal_Bool WriteTextWithCurrency_Impl( const ::rtl::OUString& rString, const ::com::sun::star::lang::Locale& rLocale ); SAL_DLLPRIVATE void ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt32 nKey, diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index c4113ca7aa9f..4ade92824a5f 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -744,6 +744,7 @@ namespace xmloff { namespace token { XML_FIELD_NUMBER, XML_FILE_NAME, XML_FILL, + XML_FILL_CHARACTER, XML_FILL_COLOR, XML_FILL_GRADIENT_NAME, XML_FILL_HATCH_NAME, diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index f7d8f2814806..cbbd48b21b0c 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -748,6 +748,7 @@ namespace xmloff { namespace token { TOKEN( "field-number", XML_FIELD_NUMBER ), TOKEN( "file-name", XML_FILE_NAME ), TOKEN( "fill", XML_FILL ), + TOKEN( "fill-character", XML_FILL_CHARACTER ), TOKEN( "fill-color", XML_FILL_COLOR ), TOKEN( "fill-gradient-name", XML_FILL_GRADIENT_NAME ), TOKEN( "fill-hatch-name", XML_FILL_HATCH_NAME ), diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 9ff20eaf01ab..d11e5ee05a27 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -533,6 +533,14 @@ void SvXMLNumFmtExport::WriteMinutesElement_Impl( sal_Bool bLong ) sal_True, sal_False ); } +void SvXMLNumFmtExport::WriteRepeatedElement_Impl( sal_Unicode nChar ) +{ + FinishTextElement_Impl(); + SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_FILL_CHARACTER, + sal_True, sal_False ); + rExport.Characters( OUString::valueOf( nChar ) ); +} + void SvXMLNumFmtExport::WriteSecondsElement_Impl( sal_Bool bLong, sal_uInt16 nDecimals ) { FinishTextElement_Impl(); @@ -1563,6 +1571,14 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt WriteAMPMElement_Impl(); // short/long? bAnyContent = sal_True; break; + case NF_SYMBOLTYPE_STAR : + // export only if ODF 1.2 extensions are enabled + if( SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012 ) + { + if ( pElemStr && pElemStr->Len() > 1 ) + WriteRepeatedElement_Impl( pElemStr->GetChar( 1 ) ); + } + break; } nPrevType = nElemType; ++nPos; diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 7221f2af606c..6d4994ad6753 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -248,6 +248,7 @@ public: enum SvXMLStyleTokens { XML_TOK_STYLE_TEXT, + XML_TOK_STYLE_FILL_CHARACTER, XML_TOK_STYLE_NUMBER, XML_TOK_STYLE_SCIENTIFIC_NUMBER, XML_TOK_STYLE_FRACTION, @@ -518,6 +519,7 @@ const SvXMLTokenMap& SvXMLNumImpData::GetStyleElemTokenMap() { // elements in a style { XML_NAMESPACE_NUMBER, XML_TEXT, XML_TOK_STYLE_TEXT }, + { XML_NAMESPACE_NUMBER, XML_FILL_CHARACTER, XML_TOK_STYLE_FILL_CHARACTER }, { XML_NAMESPACE_NUMBER, XML_NUMBER, XML_TOK_STYLE_NUMBER }, { XML_NAMESPACE_NUMBER, XML_SCIENTIFIC_NUMBER, XML_TOK_STYLE_SCIENTIFIC_NUMBER }, { XML_NAMESPACE_NUMBER, XML_FRACTION, XML_TOK_STYLE_FRACTION }, @@ -1100,6 +1102,13 @@ void SvXMLNumFmtElementContext::EndElement() case XML_TOK_STYLE_TEXT_CONTENT: rParent.AddToCode( OUString::valueOf((sal_Unicode)'@') ); break; + case XML_TOK_STYLE_FILL_CHARACTER: + if ( aContent.getLength() ) + { + rParent.AddToCode( OUString::valueOf((sal_Unicode)'*') ); + rParent.AddToCode( OUString::valueOf( aContent[0] ) ); + } + break; case XML_TOK_STYLE_BOOLEAN: // ignored - only default boolean format is supported break; @@ -1432,6 +1441,7 @@ SvXMLImportContext* SvXMLNumFormatContext::CreateChildContext( switch (nToken) { case XML_TOK_STYLE_TEXT: + case XML_TOK_STYLE_FILL_CHARACTER: case XML_TOK_STYLE_NUMBER: case XML_TOK_STYLE_SCIENTIFIC_NUMBER: case XML_TOK_STYLE_FRACTION: |