summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2019-04-13 09:31:56 +0300
committerJustin Luth <justin_luth@sil.org>2019-04-13 16:16:13 +0200
commitd7e6c898f5ec8fbd142f9d3e1c46dfcf90edfc27 (patch)
tree43b2f6fac578c463bd4cedcb82299b909a367173 /writerfilter/source
parenta1a8fda4205581046b021120cae4b7b7e46ef14a (diff)
tdf#124637 writerfilter: partially revert import section margins
...from LO6.3 commit 8d4a7b17e60aa889d1a78da47630aae2d1c1513c Footnotes and Endnotes are also considered sections, and those sections are messing up tracking which page style is in effect. Simply reverting since any fix will still be based on page style assumptions and require losts of testing. The original commit didn't fix any reported bug anyway. Change-Id: I3597d511d9755f48e7ac2ae9cfb2f8ff63c74d17 Reviewed-on: https://gerrit.libreoffice.org/70702 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx18
1 files changed, 2 insertions, 16 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index de14f1066a43..cf5f3b4d3381 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -682,27 +682,12 @@ void SectionPropertyMap::DontBalanceTextColumns()
}
}
-void SectionPropertyMap::ApplySectionProperties( const uno::Reference< beans::XPropertySet >& xSection, DomainMapper_Impl& rDM_Impl )
+void SectionPropertyMap::ApplySectionProperties( const uno::Reference< beans::XPropertySet >& xSection, DomainMapper_Impl& /*rDM_Impl*/ )
{
try
{
if ( xSection.is() )
{
- // Margins only valid if page style is already determined.
- // Take some care not to create an automatic page style (with GetPageStyle) if it isn't already created.
- if ( !m_aFollowPageStyle.is() && !m_sFollowPageStyleName.isEmpty() )
- GetPageStyle( rDM_Impl.GetPageStyles(), rDM_Impl.GetTextFactory(), false );
- if ( m_aFollowPageStyle.is() )
- {
- sal_Int32 nPageMargin = 0;
- m_aFollowPageStyle->getPropertyValue( getPropertyName( PROP_LEFT_MARGIN ) ) >>= nPageMargin;
- xSection->setPropertyValue( "SectionLeftMargin", uno::makeAny(m_nLeftMargin - nPageMargin) );
-
- nPageMargin = 0;
- m_aFollowPageStyle->getPropertyValue( getPropertyName( PROP_RIGHT_MARGIN ) ) >>= nPageMargin;
- xSection->setPropertyValue( "SectionRightMargin", uno::makeAny(m_nRightMargin - nPageMargin) );
- }
-
boost::optional< PropertyMap::Property > pProp = getProperty( PROP_WRITING_MODE );
if ( pProp )
xSection->setPropertyValue( "WritingMode", pProp->second );
@@ -1236,6 +1221,7 @@ void SectionPropertyMap::InheritOrFinalizePageStyles( DomainMapper_Impl& rDM_Imp
// otherwise apply this section's settings to the new style.
// Ensure that FollowPage is inherited first - otherwise GetPageStyle may auto-create a follow when checking FirstPage.
SectionPropertyMap* pLastContext = rDM_Impl.GetLastSectionContext();
+ //tdf124637 TODO: identify and skip special sections (like footnotes/endnotes)
if ( pLastContext && m_sFollowPageStyleName.isEmpty() )
m_sFollowPageStyleName = pLastContext->GetPageStyleName();
else