[Libreoffice-commits] core.git: writerfilter/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 30 05:19:41 UTC 2018
writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 3 +-
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 17 +++++++--------
writerfilter/source/dmapper/DomainMapper_Impl.hxx | 10 +++++++-
3 files changed, 19 insertions(+), 11 deletions(-)
New commits:
commit d3db6ff43a531ecf1afc858a0a8832353d091644
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Oct 29 23:00:37 2018 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Oct 30 06:19:17 2018 +0100
tdf#116989: disable conversion of tables in footers to floating for now
As the floating objects anchored to footers aren't wrapped around properly
(they behave as if they are wrapped through unconditionally), which makes
imported tables to overlap the page body text making the document unusable,
let's just disable the conversion for the time being (until the actual bug
fixed properly).
Change-Id: I06c984ff7157b71fff2aa8122cc475a1199994c6
Reviewed-on: https://gerrit.libreoffice.org/62523
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 01c7f59fc314..04fd361b7e36 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -1176,7 +1176,8 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab
m_aTableProperties->getValue(TablePropertyMap::TABLE_WIDTH_TYPE, nTableWidthType);
if (m_rDMapper_Impl.GetSectionContext() && nestedTableLevel <= 1 && !m_rDMapper_Impl.IsInHeaderFooter())
m_rDMapper_Impl.m_aPendingFloatingTables.emplace_back(xStart, xEnd, comphelper::containerToSequence(aFrameProperties), nTableWidth, nTableWidthType);
- else
+ else if (!m_rDMapper_Impl.IsInFooter()) // FIXME: tdf#116989 floating objects anchored
+ //to footer cannot have proper wrapping
{
// m_xText points to the body text, get the current xText from m_rDMapper_Impl, in case e.g. we would be in a header.
uno::Reference<text::XTextAppendAndConvert> xTextAppendAndConvert(m_rDMapper_Impl.GetTopTextAppend(), uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 835e6ff53920..d9edde3eaf22 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -212,7 +212,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_sDefaultParaStyleName(),
m_bInStyleSheetImport( false ),
m_bInAnyTableImport( false ),
- m_bInHeaderFooterImport( false ),
+ m_eInHeaderFooterImport( HeaderFooterImportState::none ),
m_bDiscardHeaderFooter( false ),
m_bInFootOrEndnote(false),
m_bSeenFootOrEndnoteSeparator(false),
@@ -424,7 +424,7 @@ void DomainMapper_Impl::RemoveLastParagraph( )
// (but only for paste/insert, not load; otherwise it can happen that
// flys anchored at the disposed paragraph are deleted (fdo47036.rtf))
bool const bEndOfDocument(m_aTextAppendStack.size() == 1);
- if ((m_bInHeaderFooterImport || (bEndOfDocument && !m_bIsNewDoc))
+ if ((IsInHeaderFooter() || (bEndOfDocument && !m_bIsNewDoc))
&& xEnumerationAccess.is())
{
uno::Reference<container::XEnumeration> xEnumeration = xEnumerationAccess->createEnumeration();
@@ -1635,7 +1635,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, const Proper
{
if (m_bStartTOC || m_bStartIndex || m_bStartBibliography || m_bStartGenericField)
{
- if(m_bInHeaderFooterImport && !m_bStartTOCHeaderFooter)
+ if (IsInHeaderFooter() && !m_bStartTOCHeaderFooter)
{
xTextRange = xTextAppend->appendTextPortion(rString, aValues);
}
@@ -1899,7 +1899,8 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::P
const PropertyIds ePropTextLeft = bHeader? PROP_HEADER_TEXT_LEFT: PROP_FOOTER_TEXT_LEFT;
const PropertyIds ePropText = bHeader? PROP_HEADER_TEXT: PROP_FOOTER_TEXT;
- m_bInHeaderFooterImport = true;
+ m_eInHeaderFooterImport
+ = bHeader ? HeaderFooterImportState::header : HeaderFooterImportState::footer;
//get the section context
PropertyMapPtr pContext = DomainMapper_Impl::GetTopContextOfType(CONTEXT_SECTION);
@@ -1976,7 +1977,7 @@ void DomainMapper_Impl::PopPageHeaderFooter()
}
m_bDiscardHeaderFooter = false;
}
- m_bInHeaderFooterImport = false;
+ m_eInHeaderFooterImport = HeaderFooterImportState::none;
if (!m_aHeaderFooterStack.empty())
{
@@ -2384,7 +2385,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
}
}
}
- if (!m_bInHeaderFooterImport && !checkZOrderStatus)
+ if (!IsInHeaderFooter() && !checkZOrderStatus)
xProps->setPropertyValue(
getPropertyName( PROP_OPAQUE ),
uno::makeAny( true ) );
@@ -3668,7 +3669,7 @@ void DomainMapper_Impl::handleToc
{
OUString sValue;
m_bStartTOC = true;
- if(m_bInHeaderFooterImport)
+ if (IsInHeaderFooter())
m_bStartTOCHeaderFooter = true;
bool bTableOfFigures = false;
bool bHyperlinks = false;
@@ -5002,7 +5003,7 @@ void DomainMapper_Impl::PopFieldContext()
m_bStartTOC = false;
m_bStartIndex = false;
m_bStartBibliography = false;
- if(m_bInHeaderFooterImport && m_bStartTOCHeaderFooter)
+ if (IsInHeaderFooter() && m_bStartTOCHeaderFooter)
m_bStartTOCHeaderFooter = false;
}
else
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index fdf0e7b6e6bb..89deb65f1b56 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -478,7 +478,12 @@ private:
OUString m_sDefaultParaStyleName; //caches the ConvertedStyleName of the default paragraph style
bool m_bInStyleSheetImport; //in import of fonts, styles, lists or lfos
bool m_bInAnyTableImport; //in import of fonts, styles, lists or lfos
- bool m_bInHeaderFooterImport;
+ enum class HeaderFooterImportState
+ {
+ none,
+ header,
+ footer,
+ } m_eInHeaderFooterImport;
bool m_bDiscardHeaderFooter;
bool m_bInFootOrEndnote;
/// Did we get a <w:separator/> for this footnote already?
@@ -718,7 +723,8 @@ public:
void PushPageFooter(SectionPropertyMap::PageType eType);
void PopPageHeaderFooter();
- bool IsInHeaderFooter() const { return m_bInHeaderFooterImport; }
+ bool IsInHeaderFooter() const { return m_eInHeaderFooterImport != HeaderFooterImportState::none; }
+ bool IsInFooter() const { return m_eInHeaderFooterImport == HeaderFooterImportState::footer; }
bool IsInTOC() const { return m_bStartTOC; }
More information about the Libreoffice-commits
mailing list