[Libreoffice-commits] .: Branch 'libreoffice-3-6' - writerfilter/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Fri Jun 15 06:33:03 PDT 2012


 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    4 ++--
 writerfilter/source/dmapper/SettingsTable.cxx     |   10 ++++++++++
 writerfilter/source/dmapper/SettingsTable.hxx     |    2 ++
 3 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 975e916421f46e913f0fec1b8a9372ac3dc57382
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Jun 15 15:09:53 2012 +0200

    n#750935 fix docx import of w:evenAndOddHeaders
    
    Change-Id: I172073bac10e8d0449c0f5c0a226dd7ace013376

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 546613a..165fd2f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1271,7 +1271,7 @@ void DomainMapper_Impl::PushPageHeader(SectionPropertyMap::PageType eType)
                     uno::makeAny(sal_True) );
             // if a left header is available then header are not shared
             bool bLeft = eType == SectionPropertyMap::PAGE_LEFT;
-            if( bLeft )
+            if( bLeft && m_pSettingsTable->GetEvenAndOddHeaders())
                 xPageStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_HEADER_IS_SHARED), uno::makeAny( false ));
 
             //set the interface
@@ -1310,7 +1310,7 @@ void DomainMapper_Impl::PushPageFooter(SectionPropertyMap::PageType eType)
                     uno::makeAny(sal_True) );
             // if a left header is available then footer is not shared
             bool bLeft = eType == SectionPropertyMap::PAGE_LEFT;
-            if( bLeft )
+            if( bLeft && m_pSettingsTable->GetEvenAndOddHeaders())
                 xPageStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_FOOTER_IS_SHARED), uno::makeAny( false ));
             //set the interface
             uno::Reference< text::XText > xFooterText;
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index ab89c6a..2a69cc6 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -76,6 +76,7 @@ struct SettingsTable_Impl
     ::rtl::OUString     m_sSalt;
     bool                m_bLinkStyles;
     sal_Int16           m_nZoomFactor;
+    bool                m_bEvenAndOddHeaders;
 
     SettingsTable_Impl( DomainMapper& rDMapper, const uno::Reference< lang::XMultiServiceFactory > xTextFactory ) :
     m_rDMapper( rDMapper )
@@ -94,6 +95,7 @@ struct SettingsTable_Impl
     , m_nCryptSpinCount(0)
     , m_bLinkStyles(false)
     , m_nZoomFactor(0)
+    , m_bEvenAndOddHeaders(false)
     {}
 
 };
@@ -165,6 +167,9 @@ void SettingsTable::lcl_sprm(Sprm& rSprm)
     case NS_ooxml::LN_CT_Settings_linkStyles: // 92663;
     m_pImpl->m_bLinkStyles = nIntValue;
     break;
+    case NS_ooxml::LN_CT_Settings_evenAndOddHeaders:
+    m_pImpl->m_bEvenAndOddHeaders = nIntValue;
+    break;
     case NS_ooxml::LN_CT_Settings_noPunctuationKerning: //  92526;
     m_pImpl->m_bNoPunctuationKerning = nIntValue ? true : false;
     break;
@@ -230,6 +235,11 @@ sal_Int16 SettingsTable::GetZoomFactor() const
     return m_pImpl->m_nZoomFactor;
 }
 
+bool SettingsTable::GetEvenAndOddHeaders() const
+{
+    return m_pImpl->m_bEvenAndOddHeaders;
+}
+
 void SettingsTable::ApplyProperties( uno::Reference< text::XTextDocument > xDoc )
 {
     uno::Reference< beans::XPropertySet> xDocProps( xDoc, uno::UNO_QUERY );
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx
index 3d9a560..2c43ec6 100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -70,6 +70,8 @@ class WRITERFILTER_DLLPRIVATE SettingsTable : public LoggedProperties, public Lo
     /// What's the zoom factor set in percents?
     sal_Int16 GetZoomFactor() const;
 
+    bool GetEvenAndOddHeaders() const;
+
     void ApplyProperties( uno::Reference< text::XTextDocument > xDoc );
 
  private:


More information about the Libreoffice-commits mailing list