summaryrefslogtreecommitdiff
path: root/xmloff/source
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2001-05-09 13:47:17 +0000
committerChristian Lippka <cl@openoffice.org>2001-05-09 13:47:17 +0000
commit36cbe28795f6ae49f566472e19530086306946f1 (patch)
tree8dc8e37d00140cdd1d302d8921b8cb3e3e44da3a /xmloff/source
parent621a12dc74c7063e2f995300acc3404c3112479b (diff)
#86415# added support for number styles in draw&impress
Diffstat (limited to 'xmloff/source')
-rw-r--r--xmloff/source/text/txtflde.cxx13
-rw-r--r--xmloff/source/text/txtimp.cxx32
2 files changed, 30 insertions, 15 deletions
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 532250a67685..73f84f0c96bb 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtflde.cxx,v $
*
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: dvo $ $Date: 2001-03-23 16:30:17 $
+ * last change: $Author: cl $ $Date: 2001-05-09 14:47:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -896,7 +896,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle(
// nFormat may be -1 for numeric fields that display their
// variable name. (Maybe this should be a field type, then?)
if (nFormat != -1) {
- GetExport().addDataStyle(nFormat);
+ GetExport().addDataStyle(nFormat, nToken == FIELD_ID_TIME );
}
}
break;
@@ -1217,7 +1217,7 @@ void XMLTextFieldExport::ExportFieldHelper(
ProcessValueAndType(sal_False,
GetIntProperty(sPropertyNumberFormat,rPropSet),
sEmpty, sEmpty, 0.0, // not used
- sal_False, sal_False, sal_True);
+ sal_False, sal_False, sal_True, sal_True);
}
if (xPropSetInfo->hasPropertyByName(sPropertyDateTimeValue))
{
@@ -2096,7 +2096,8 @@ void XMLTextFieldExport::ProcessValueAndType(
double fValue, /// float content; possibly invalid
sal_Bool bExportValue, /// export value attribute?
sal_Bool bExportValueType, /// export value-type attribute?
- sal_Bool bExportStyle) /// export style-sttribute?
+ sal_Bool bExportStyle, /// export style-sttribute?
+ sal_Bool bTimeStyle) // exporting a time style?
{
// String or number?
if (bIsString)
@@ -2137,7 +2138,7 @@ void XMLTextFieldExport::ProcessValueAndType(
GetExport().AddAttribute(XML_NAMESPACE_STYLE,
sXML_data_style_name,
GetExport().getDataStyleName(
- nFormatKey));
+ nFormatKey, bTimeStyle));
} // else: ignore (no number format)
}
}
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 84ccfc296baa..263c73a112d8 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtimp.cxx,v $
*
- * $Revision: 1.71 $
+ * $Revision: 1.72 $
*
- * last change: $Author: dvo $ $Date: 2001-05-04 14:42:58 $
+ * last change: $Author: cl $ $Date: 2001-05-09 14:47:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -208,6 +208,9 @@
#ifndef _XMLOFF_FORMSIMP_HXX
#include "formsimp.hxx"
#endif
+#ifndef _XMLOFF_NUMBERSTYLESIMPORT_HXX
+#include "XMLNumberStylesImport.hxx"
+#endif
using namespace ::rtl;
using namespace ::std;
@@ -1608,15 +1611,26 @@ SvXMLImportContext *XMLTextImportHelper::CreateTableChildContext(
/// get data style key for use with NumberFormat property
sal_Int32 XMLTextImportHelper::GetDataStyleKey(const OUString& sStyleName)
{
- // get appropriate context
- SvXMLNumFormatContext* pStyle =
- PTR_CAST( SvXMLNumFormatContext,
- ((SvXMLStylesContext *)&xAutoStyles)->
+ const SvXMLStyleContext* pStyle = ((SvXMLStylesContext *)&xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE,
- sStyleName, sal_True ) );
+ sStyleName, sal_True );
- // return key or default (-1)
- return (0 != pStyle) ? pStyle->GetKey() : -1;
+ // get appropriate context
+ SvXMLNumFormatContext* pNumStyle = PTR_CAST( SvXMLNumFormatContext, pStyle );
+ if( pNumStyle )
+ {
+ // return key
+ return pNumStyle->GetKey();
+ }
+ else
+ {
+ // for the impress and draw application that do not have a number formater
+ // check if its one of their styles.
+ SdXMLNumberFormatImportContext* pSdNumStyle = PTR_CAST( SdXMLNumberFormatImportContext, pStyle );
+
+ // return key or default (-1)
+ return (0 != pSdNumStyle) ? pSdNumStyle->GetKey() : -1;
+ }
}
const SvxXMLListStyleContext *XMLTextImportHelper::FindAutoListStyle( const OUString& rName ) const