[Libreoffice-commits] core.git: sw/qa sw/source writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Oct 28 08:49:56 PDT 2013
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 2 ++
sw/source/filter/ww8/docxattributeoutput.cxx | 10 +++++++++-
writerfilter/source/dmapper/StyleSheetTable.cxx | 8 ++++++--
3 files changed, 17 insertions(+), 3 deletions(-)
New commits:
commit 95e2a96f02512943eaa796facd238667de4bd964
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Oct 28 16:32:34 2013 +0100
DOCX filter: roundtrip semiHidden and unhideWhenUsed for table styles
Change-Id: Ie7073a6346553650741a1631096342318d650890
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d3dcf42..9db8db8 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1454,6 +1454,8 @@ void Test::testStyleInheritance()
// Table style wasn't roundtripped.
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:tblPr/w:tblCellMar/w:left", "w", "108");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:semiHidden", 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:unhideWhenUsed", 1);
}
void Test::testCalendar1()
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3fafa96..089f735 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2811,7 +2811,7 @@ void lcl_TableStyleTcPr(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence<b
void DocxAttributeOutput::TableStyle(uno::Sequence<beans::PropertyValue>& rStyle)
{
- bool bDefault = false, bCustomStyle = false, bQFormat = false;
+ bool bDefault = false, bCustomStyle = false, bQFormat = false, bSemiHidden = false, bUnhideWhenUsed = false;
OUString aStyleId, aName, aBasedOn;
sal_Int32 nUiPriority = 0, nRsid = 0;
uno::Sequence<beans::PropertyValue> aTblPr, aTcPr;
@@ -2831,6 +2831,10 @@ void DocxAttributeOutput::TableStyle(uno::Sequence<beans::PropertyValue>& rStyle
nUiPriority = rStyle[i].Value.get<sal_Int32>();
else if (rStyle[i].Name == "qFormat")
bQFormat = true;
+ else if (rStyle[i].Name == "semiHidden")
+ bSemiHidden = true;
+ else if (rStyle[i].Name == "unhideWhenUsed")
+ bUnhideWhenUsed = true;
else if (rStyle[i].Name == "rsid")
nRsid = rStyle[i].Value.get<sal_Int32>();
else if (rStyle[i].Name == "tblPr")
@@ -2863,6 +2867,10 @@ void DocxAttributeOutput::TableStyle(uno::Sequence<beans::PropertyValue>& rStyle
FSEND);
if (bQFormat)
m_pSerializer->singleElementNS(XML_w, XML_qFormat, FSEND);
+ if (bSemiHidden)
+ m_pSerializer->singleElementNS(XML_w, XML_semiHidden, FSEND);
+ if (bUnhideWhenUsed)
+ m_pSerializer->singleElementNS(XML_w, XML_unhideWhenUsed, FSEND);
if (nRsid)
{
// We want the rsid as a hex string, but always with the length of 8.
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 3a5127f..b3a3cd7 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -584,8 +584,6 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
case NS_ooxml::LN_CT_Style_link:
case NS_ooxml::LN_CT_Style_autoRedefine:
case NS_ooxml::LN_CT_Style_hidden:
- case NS_ooxml::LN_CT_Style_semiHidden:
- case NS_ooxml::LN_CT_Style_unhideWhenUsed:
case NS_ooxml::LN_CT_Style_locked:
case NS_ooxml::LN_CT_Style_personal:
case NS_ooxml::LN_CT_Style_personalCompose:
@@ -608,6 +606,8 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
break;
case NS_ooxml::LN_CT_Style_rsid:
case NS_ooxml::LN_CT_Style_qFormat:
+ case NS_ooxml::LN_CT_Style_semiHidden:
+ case NS_ooxml::LN_CT_Style_unhideWhenUsed:
case NS_ooxml::LN_CT_Style_uiPriority:
if(m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE)
{
@@ -620,6 +620,10 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
}
else if (nSprmId == NS_ooxml::LN_CT_Style_qFormat)
aValue.Name = "qFormat";
+ else if (nSprmId == NS_ooxml::LN_CT_Style_semiHidden)
+ aValue.Name = "semiHidden";
+ else if (nSprmId == NS_ooxml::LN_CT_Style_unhideWhenUsed)
+ aValue.Name = "unhideWhenUsed";
else
{
aValue.Name = "uiPriority";
More information about the Libreoffice-commits
mailing list