diff options
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Writer.xcs | 11 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 21 |
2 files changed, 26 insertions, 6 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index 520737ab7e24..012ca4073fe3 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -6492,6 +6492,17 @@ <value>0</value> </prop> </group> + <group oor:name="HTML"> + <info> + <desc>Contains settings for the HTML filter.</desc> + </info> + <prop oor:name="IncludeHiddenText" oor:type="xs:boolean" oor:nillable="false"> + <info> + <desc>Whether hidden text (sections, etc) is included in the output.</desc> + </info> + <value>false</value> + </prop> + </group> </group> <group oor:name="Wizards"> <info> diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 7134d787b8ca..a3b900b6a222 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -83,6 +83,7 @@ #include <unotools/tempfile.hxx> #include <comphelper/sequenceashashmap.hxx> #include <officecfg/Office/Common.hxx> +#include <officecfg/Office/Writer.hxx> #include <comphelper/propertysequence.hxx> #include <comphelper/sequence.hxx> @@ -881,6 +882,7 @@ static Writer& OutHTML_Section( Writer& rWrt, const SwSectionNode& rSectNd ) void SwHTMLWriter::Out_SwDoc( SwPaM* pPam ) { bool bSaveWriteAll = m_bWriteAll; // save + bool bIncludeHidden = officecfg::Office::Writer::FilterFlags::HTML::IncludeHiddenText::get(); // search next text::Bookmark position from text::Bookmark table m_nBkmkTabPos = m_bWriteAll ? FindPos_Bkmk( *m_pCurrentPam->GetPoint() ) : -1; @@ -901,14 +903,17 @@ void SwHTMLWriter::Out_SwDoc( SwPaM* pPam ) OSL_ENSURE( !(rNd.IsGrfNode() || rNd.IsOLENode()), "Unexpected Grf- or OLE-Node here" ); + if( rNd.IsTextNode() ) { SwTextNode* pTextNd = rNd.GetTextNode(); + if (!pTextNd->IsHidden() || bIncludeHidden) + { + if (!m_bFirstLine) + m_pCurrentPam->GetPoint()->Assign(*pTextNd, 0); - if( !m_bFirstLine ) - m_pCurrentPam->GetPoint()->Assign( *pTextNd, 0 ); - - OutHTML_SwTextNode( *this, *pTextNd ); + OutHTML_SwTextNode(*this, *pTextNd); + } } else if( rNd.IsTableNode() ) { @@ -917,8 +922,12 @@ void SwHTMLWriter::Out_SwDoc( SwPaM* pPam ) } else if( rNd.IsSectionNode() ) { - OutHTML_Section( *this, *rNd.GetSectionNode() ); - m_nBkmkTabPos = m_bWriteAll ? FindPos_Bkmk( *m_pCurrentPam->GetPoint() ) : -1; + SwSectionNode* pSectionNode = rNd.GetSectionNode(); + if (!pSectionNode->GetSection().IsHiddenFlag() || bIncludeHidden) + { + OutHTML_Section( *this, *pSectionNode ); + m_nBkmkTabPos = m_bWriteAll ? FindPos_Bkmk( *m_pCurrentPam->GetPoint() ) : -1; + } } else if( &rNd == &m_pDoc->GetNodes().GetEndOfContent() ) break; |