summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-06-29 02:50:48 +0200
committerBosdonnat Cedric <cedric.bosdonnat@free.fr>2013-07-01 13:34:56 +0000
commit297363822d460321c0b3bdd4a8acc9f689f4661b (patch)
treeb0c37fbc40426df950f3270875f2e1775e53aed5
parent902f6d61e1e9ffdf39544d8b168996b0093ac57e (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 (cherry picked from commit 5b9bad7482a98f2d0d37c4b75a13292abe653ea3) Reviewed-on: https://gerrit.libreoffice.org/4615 Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr> Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
-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 2b72e894df0e..9089f2718924 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>
@@ -4011,7 +4012,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());
@@ -4138,7 +4139,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);
}