Kaydet (Commit) f18a2429 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

use correct namespace for calc odf extensions

Change-Id: I6e0feab7e1d649fbf4dafb9f06d57f68e9a4b934
üst 655d6104
......@@ -3820,17 +3820,17 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
ScColorFormatList* pColorFormatList = pDoc->GetColorScaleList(nTab);
if(pCondFormatList || pColorFormatList)
{
SvXMLElementExport aElementCondFormats(*this, XML_NP_TABLE_EXT, XML_CONDITIONAL_FORMATS, true, true);
SvXMLElementExport aElementCondFormats(*this, XML_NAMESPACE_CALC_EXT, XML_CONDITIONAL_FORMATS, true, true);
if(pCondFormatList)
{
for(ScConditionalFormatList::const_iterator itr = pCondFormatList->begin();
itr != pCondFormatList->end(); ++itr)
{
SvXMLElementExport aElementCondFormat(*this, XML_NP_TABLE_EXT, XML_CONDITIONAL_FORMAT, true, true);
SvXMLElementExport aElementCondFormat(*this, XML_NAMESPACE_CALC_EXT, XML_CONDITIONAL_FORMAT, true, true);
rtl::OUString sRangeList;
//ScRangeStringConverter::GetStringFromRangeList( sRanges, rRangeList, pDoc, FormulaGrammar::CONV_OOO );
AddAttribute(XML_NP_TABLE_EXT, XML_TARGET_RANGE_ADDRESS, sRangeList);
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TARGET_RANGE_ADDRESS, sRangeList);
}
}
......@@ -3842,43 +3842,64 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
rtl::OUString sRangeList;
const ScRangeList& rRangeList = itr->GetRange();
ScRangeStringConverter::GetStringFromRangeList( sRangeList, &rRangeList, pDoc, FormulaGrammar::CONV_OOO );
AddAttribute(XML_NP_TABLE_EXT, XML_TARGET_RANGE_ADDRESS, sRangeList);
SvXMLElementExport aElementColFormat(*this, XML_NP_TABLE_EXT, XML_CONDITIONAL_FORMAT, true, true);
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TARGET_RANGE_ADDRESS, sRangeList);
SvXMLElementExport aElementColFormat(*this, XML_NAMESPACE_CALC_EXT, XML_CONDITIONAL_FORMAT, true, true);
if(itr->GetType() == COLORSCALE)
{
SvXMLElementExport aElementColorScale(*this, XML_NP_TABLE_EXT, XML_COLOR_SCALE, true, true);
SvXMLElementExport aElementColorScale(*this, XML_NAMESPACE_CALC_EXT, XML_COLOR_SCALE, true, true);
const ScColorScaleFormat& mrColorScale = static_cast<const ScColorScaleFormat&>(*itr);
for(ScColorScaleFormat::const_iterator it = mrColorScale.begin();
it != mrColorScale.end(); ++it)
{
if(it->GetFormula())
{
rtl::OUString sFormula;
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, sFormula);
}
else
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, rtl::OUString::valueOf(it->GetValue()));
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*it));
rtl::OUStringBuffer aBuffer;
::sax::Converter::convertColor(aBuffer, it->GetColor().GetColor());
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_COLOR, aBuffer.makeStringAndClear());
SvXMLElementExport aElementColorScaleEntry(*this, XML_NAMESPACE_CALC_EXT, XML_COLOR_SCALE_ENTRY, true, true);
}
}
else if(itr->GetType() == DATABAR)
{
const ScDataBarFormatData* pFormatData = static_cast<const ScDataBarFormat&>(*itr).GetDataBarData();
if(!pFormatData->mbGradient)
AddAttribute(XML_NP_TABLE_EXT, XML_GRADIENT, XML_FALSE);
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_GRADIENT, XML_FALSE);
rtl::OUStringBuffer aBuffer;
::sax::Converter::convertColor(aBuffer, pFormatData->maPositiveColor.GetColor());
AddAttribute(XML_NP_TABLE_EXT, XML_POSITIVE_COLOR, aBuffer.makeStringAndClear());
SvXMLElementExport aElementDataBar(*this, XML_NP_TABLE_EXT, XML_DATA_BAR, true, true);
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_POSITIVE_COLOR, aBuffer.makeStringAndClear());
SvXMLElementExport aElementDataBar(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_BAR, true, true);
if(pFormatData->mpLowerLimit->GetFormula())
{
rtl::OUString sFormula;
AddAttribute(XML_NP_TABLE_EXT, XML_VALUE, sFormula);
if(pFormatData->mpLowerLimit->GetFormula())
{
rtl::OUString sFormula;
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, sFormula);
}
else
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, rtl::OUString::valueOf(pFormatData->mpLowerLimit->GetValue()));
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpLowerLimit));
SvXMLElementExport aElementDataBarEntryLower(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_BAR_ENTRY, true, true);
}
else
AddAttribute(XML_NP_TABLE_EXT, XML_VALUE, rtl::OUString::valueOf(pFormatData->mpLowerLimit->GetValue()));
AddAttribute(XML_NP_TABLE_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpLowerLimit));
SvXMLElementExport aElementDataBarEntryLower(*this, XML_NP_TABLE_EXT, XML_DATA_BAR_ENTRY, true, true);
if(pFormatData->mpUpperLimit->GetFormula())
{
rtl::OUString sFormula;
AddAttribute(XML_NP_TABLE_EXT, XML_VALUE, sFormula);
if(pFormatData->mpUpperLimit->GetFormula())
{
rtl::OUString sFormula;
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, sFormula);
}
else
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, rtl::OUString::valueOf(pFormatData->mpUpperLimit->GetValue()));
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpUpperLimit));
SvXMLElementExport aElementDataBarEntryUpper(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_BAR_ENTRY, true, true);
}
else
AddAttribute(XML_NP_TABLE_EXT, XML_VALUE, rtl::OUString::valueOf(pFormatData->mpUpperLimit->GetValue()));
AddAttribute(XML_NP_TABLE_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpUpperLimit));
SvXMLElementExport aElementDataBarEntryUpper(*this, XML_NP_TABLE_EXT, XML_DATA_BAR_ENTRY, true, true);
}
}
}
......
......@@ -90,8 +90,9 @@ XML_NAMESPACE_EXT( OFFICE, 37U )
XML_NAMESPACE_EXT( TABLE, 38U )
XML_NAMESPACE_EXT( CHART, 39U )
XML_NAMESPACE_EXT( DRAW, 40U )
XML_NAMESPACE_EXT( CALC, 41U )
#define _XML_OLD_NAMESPACE_BASE 41U
#define _XML_OLD_NAMESPACE_BASE 42U
// namespaces used in the technical preview (SO 5.2)
XML_OLD_NAMESPACE( FO, 0U )
......
......@@ -160,6 +160,10 @@ namespace xmloff { namespace token {
XML_NP_CSS3TEXT,
XML_N_CSS3TEXT,
// calc extensions
XML_NP_CALC_EXT,
XML_N_CALC_EXT,
// units
XML_UNIT_MM,
XML_UNIT_M,
......@@ -426,6 +430,7 @@ namespace xmloff { namespace token {
XML_COLOR_INVERSION,
XML_COLOR_MODE,
XML_COLOR_SCALE,
XML_COLOR_SCALE_ENTRY,
XML_COLUMN,
XML_COLUMN_COUNT,
XML_COLUMN_GAP,
......
......@@ -374,6 +374,9 @@ void SvXMLExport::_InitCtor()
{
mpNamespaceMap->Add(
GetXMLToken(XML_NP_TABLE_EXT), GetXMLToken(XML_N_TABLE_EXT), XML_NAMESPACE_TABLE_EXT);
mpNamespaceMap->Add(
GetXMLToken(XML_NP_CALC_EXT), GetXMLToken(XML_N_CALC_EXT), XML_NAMESPACE_CALC_EXT);
}
}
if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
......
......@@ -164,6 +164,10 @@ namespace xmloff { namespace token {
TOKEN( "css3t", XML_NP_CSS3TEXT ),
TOKEN( "http://www.w3.org/TR/css3-text/", XML_N_CSS3TEXT ),
// extension namespace for calc extensions
TOKEN( "calcext", XML_NP_CALC_EXT ),
TOKEN( "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0", XML_N_CALC_EXT ),
// units
TOKEN( "mm", XML_UNIT_MM ),
TOKEN( "m", XML_UNIT_M ),
......@@ -430,6 +434,7 @@ namespace xmloff { namespace token {
TOKEN( "color-inversion", XML_COLOR_INVERSION ),
TOKEN( "color-mode", XML_COLOR_MODE ),
TOKEN( "color-scale", XML_COLOR_SCALE ),
TOKEN( "color-scale-entry", XML_COLOR_SCALE_ENTRY ),
TOKEN( "column", XML_COLUMN ),
TOKEN( "column-count", XML_COLUMN_COUNT ),
TOKEN( "column-gap", XML_COLUMN_GAP ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment