summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-06-29 02:50:48 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-06-29 02:56:38 +0200
commit5b9bad7482a98f2d0d37c4b75a13292abe653ea3 (patch)
treed473eee7b3f0893b66d0e40abd1d6f4e7ac9bea6
parentb3aabf223ec7bc2678fd6dfbbbbb79ab7f079e5b (diff)
handle localized default style names, fdo#61339
We need to map localized style names during import and export from and to ODF. The default styles are the only localized style names and are not imported with the name written into the file. Change-Id: Ibdc2f750b7a4b7ce6994b22248e237fe95ac638d
-rw-r--r--sc/source/filter/xml/xmlcondformat.cxx5
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx6
2 files changed, 7 insertions, 4 deletions
diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx
index 41f4f3d8cc83..afeec54fee7b 100644
--- a/sc/source/filter/xml/xmlcondformat.cxx
+++ b/sc/source/filter/xml/xmlcondformat.cxx
@@ -18,6 +18,7 @@
#include "rangeutl.hxx"
#include "docfunc.hxx"
#include "XMLConverter.hxx"
+#include "stylehelper.hxx"
ScXMLConditionalFormatsContext::ScXMLConditionalFormatsContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
@@ -566,7 +567,7 @@ ScXMLCondContext::ScXMLCondContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
sExpression = sValue;
break;
case XML_TOK_CONDITION_APPLY_STYLE_NAME:
- sStyle = sValue;
+ sStyle = ScStyleNameConversion::ProgrammaticToDisplayName(sValue, SFX_STYLE_FAMILY_PARA );
break;
case XML_TOK_CONDITION_BASE_CELL_ADDRESS:
sAddress = sValue;
@@ -764,7 +765,7 @@ ScXMLDateContext::ScXMLDateContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
sDateType = sValue;
break;
case XML_TOK_COND_DATE_STYLE:
- sStyle = sValue;
+ sStyle = ScStyleNameConversion::ProgrammaticToDisplayName(sValue, SFX_STYLE_FAMILY_PARA );
break;
default:
break;
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 3c4a2b10f707..3dcb8ba8697f 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -59,6 +59,7 @@
#include "colorscale.hxx"
#include "conditio.hxx"
#include "cellvalue.hxx"
+#include "stylehelper.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnmspe.hxx>
@@ -4000,7 +4001,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
default:
SAL_WARN("sc", "unimplemented conditional format export");
}
- OUString sStyle = pEntry->GetStyle();
+ OUString sStyle = ScStyleNameConversion::DisplayToProgrammaticName(pEntry->GetStyle(), SFX_STYLE_FAMILY_PARA);
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_APPLY_STYLE_NAME, sStyle);
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, aCond.makeStringAndClear());
@@ -4127,7 +4128,8 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
{
const ScCondDateFormatEntry& mrDateFormat = static_cast<const ScCondDateFormatEntry&>(*pFormatEntry);
OUString aDateType = getDateStringForType(mrDateFormat.GetDateType());
- AddAttribute( XML_NAMESPACE_CALC_EXT, XML_STYLE, mrDateFormat.GetStyleName());
+ OUString aStyleName = ScStyleNameConversion::DisplayToProgrammaticName(mrDateFormat.GetStyleName(), SFX_STYLE_FAMILY_PARA );
+ AddAttribute( XML_NAMESPACE_CALC_EXT, XML_STYLE, aStyleName);
AddAttribute( XML_NAMESPACE_CALC_EXT, XML_DATE, aDateType);
SvXMLElementExport aElementDateFormat(*this, XML_NAMESPACE_CALC_EXT, XML_DATE_IS, true, true);
}