summaryrefslogtreecommitdiff
path: root/xmloff/source/style/xmlnumfi.cxx
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2002-10-23 16:12:18 +0000
committerNiklas Nebel <nn@openoffice.org>2002-10-23 16:12:18 +0000
commita859cab94a8b5be04baa3996a8e0494e5e8df2fd (patch)
tree04b33bcfe29d673a9ec177a856287fa56e9f79e3 /xmloff/source/style/xmlnumfi.cxx
parentc25996f9bab8e95f06ec73e8560e6afa49b2439b (diff)
#102244# handling of formats with a text part
Diffstat (limited to 'xmloff/source/style/xmlnumfi.cxx')
-rw-r--r--xmloff/source/style/xmlnumfi.cxx22
1 files changed, 18 insertions, 4 deletions
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 347e3d25f0..998a7458c2 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlnumfi.cxx,v $
*
- * $Revision: 1.28 $
+ * $Revision: 1.29 $
*
- * last change: $Author: er $ $Date: 2002-10-08 16:11:19 $
+ * last change: $Author: nn $ $Date: 2002-10-23 17:12:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1961,9 +1961,16 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex )
//! collect all conditions first and adjust default to >=0, >0 or <0 depending on count
//! allow blanks in conditions
sal_Bool bFirstCond = ( aConditions.getLength() == 0 );
- if ( bFirstCond && sRealCond.compareToAscii( ">=0" ) == 0 )
+ if ( bFirstCond && aMyConditions.size() == 1 && sRealCond.compareToAscii( ">=0" ) == 0 )
bDefaultCond = sal_True;
+ if ( nType == XML_TOK_STYLES_TEXT_STYLE && nIndex == 2 )
+ {
+ // The third condition in a number format with a text part can only be
+ // "all other numbers", the condition string must be empty.
+ bDefaultCond = sal_True;
+ }
+
if (!bDefaultCond)
{
sal_Int32 nPos = sRealCond.indexOf( '.' );
@@ -2003,9 +2010,16 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex, const rtl::OUS
//! collect all conditions first and adjust default to >=0, >0 or <0 depending on count
//! allow blanks in conditions
sal_Bool bFirstCond = ( aConditions.getLength() == 0 );
- if ( bFirstCond && sRealCond.compareToAscii( ">=0" ) == 0 )
+ if ( bFirstCond && aMyConditions.size() == 1 && sRealCond.compareToAscii( ">=0" ) == 0 )
bDefaultCond = sal_True;
+ if ( nType == XML_TOK_STYLES_TEXT_STYLE && nIndex == 2 )
+ {
+ // The third condition in a number format with a text part can only be
+ // "all other numbers", the condition string must be empty.
+ bDefaultCond = sal_True;
+ }
+
if (!bDefaultCond)
{
sal_Int32 nPos = sRealCond.indexOf( '.' );