[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sc/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon Jul 1 06:35:18 PDT 2013
sc/source/filter/xml/xmlcondformat.cxx | 5 +++--
sc/source/filter/xml/xmlexprt.cxx | 6 ++++--
2 files changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 297363822d460321c0b3bdd4a8acc9f689f4661b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Jun 29 02:50:48 2013 +0200
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 at free.fr>
Tested-by: Bosdonnat Cedric <cedric.bosdonnat at free.fr>
diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx
index 41f4f3d..afeec54 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 2b72e89..9089f27 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);
}
More information about the Libreoffice-commits
mailing list