tdf#91920 sw page gutter margin, from top: add DOCX filter
ODF filter was already working as-is. Change-Id: I71089a5d0171eba0cd4c2d14bdee6ca9b64193b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110455 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
This commit is contained in:
BIN
sw/qa/extras/ooxmlexport/data/gutter-top.docx
Normal file
BIN
sw/qa/extras/ooxmlexport/data/gutter-top.docx
Normal file
Binary file not shown.
@@ -58,6 +58,20 @@ DECLARE_OOXMLEXPORT_TEST(testGutterLeft, "gutter-left.docx")
|
|||||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
|
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CPPUNIT_TEST_FIXTURE(Test, testGutterTop)
|
||||||
|
{
|
||||||
|
load(mpTestDocumentPath, "gutter-top.docx");
|
||||||
|
save("Office Open XML Text", maTempFile);
|
||||||
|
mbExported = true;
|
||||||
|
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
|
||||||
|
CPPUNIT_ASSERT(pXmlSettings);
|
||||||
|
// Without the accompanying fix in place, this test would have failed with:
|
||||||
|
// - Expected: 1
|
||||||
|
// - Actual : 0
|
||||||
|
// i.e. <w:gutterAtTop> was lost.
|
||||||
|
assertXPath(pXmlSettings, "/w:settings/w:gutterAtTop", 1);
|
||||||
|
}
|
||||||
|
|
||||||
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134619_numberingProps, "tdf134619_numberingProps.doc")
|
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134619_numberingProps, "tdf134619_numberingProps.doc")
|
||||||
{
|
{
|
||||||
// Get the third paragraph's numbering style's 1st level's bullet size
|
// Get the third paragraph's numbering style's 1st level's bullet size
|
||||||
|
@@ -1039,6 +1039,11 @@ void DocxExport::WriteSettings()
|
|||||||
if(isMirroredMargin())
|
if(isMirroredMargin())
|
||||||
pFS->singleElementNS(XML_w, XML_mirrorMargins);
|
pFS->singleElementNS(XML_w, XML_mirrorMargins);
|
||||||
|
|
||||||
|
if (m_rDoc.getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP))
|
||||||
|
{
|
||||||
|
pFS->singleElementNS(XML_w, XML_gutterAtTop);
|
||||||
|
}
|
||||||
|
|
||||||
// Embed Fonts
|
// Embed Fonts
|
||||||
if( m_rDoc.getIDocumentSettingAccess().get( DocumentSettingId::EMBED_FONTS ))
|
if( m_rDoc.getIDocumentSettingAccess().get( DocumentSettingId::EMBED_FONTS ))
|
||||||
pFS->singleElementNS(XML_w, XML_embedTrueTypeFonts);
|
pFS->singleElementNS(XML_w, XML_embedTrueTypeFonts);
|
||||||
|
@@ -7191,6 +7191,10 @@ void DomainMapper_Impl::ApplySettingsTable()
|
|||||||
xSettings->setPropertyValue("ProtectForm", uno::makeAny( true ));
|
xSettings->setPropertyValue("ProtectForm", uno::makeAny( true ));
|
||||||
if( m_pSettingsTable->GetReadOnly() )
|
if( m_pSettingsTable->GetReadOnly() )
|
||||||
xSettings->setPropertyValue("LoadReadonly", uno::makeAny( true ));
|
xSettings->setPropertyValue("LoadReadonly", uno::makeAny( true ));
|
||||||
|
if (m_pSettingsTable->GetGutterAtTop())
|
||||||
|
{
|
||||||
|
xSettings->setPropertyValue("GutterAtTop", uno::makeAny(true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(const uno::Exception&)
|
catch(const uno::Exception&)
|
||||||
{
|
{
|
||||||
|
@@ -275,6 +275,7 @@ struct SettingsTable_Impl
|
|||||||
OUString m_sCurrentDatabaseDataSource;
|
OUString m_sCurrentDatabaseDataSource;
|
||||||
|
|
||||||
DocumentProtection_Impl m_DocumentProtection;
|
DocumentProtection_Impl m_DocumentProtection;
|
||||||
|
bool m_bGutterAtTop = false;
|
||||||
|
|
||||||
SettingsTable_Impl() :
|
SettingsTable_Impl() :
|
||||||
m_nDefaultTabStop( 720 ) //default is 1/2 in
|
m_nDefaultTabStop( 720 ) //default is 1/2 in
|
||||||
@@ -586,6 +587,9 @@ void SettingsTable::lcl_sprm(Sprm& rSprm)
|
|||||||
case NS_ooxml::LN_CT_Compat_noLeading:
|
case NS_ooxml::LN_CT_Compat_noLeading:
|
||||||
m_pImpl->m_bNoLeading = nIntValue != 0;
|
m_pImpl->m_bNoLeading = nIntValue != 0;
|
||||||
break;
|
break;
|
||||||
|
case NS_ooxml::LN_CT_Settings_gutterAtTop:
|
||||||
|
m_pImpl->m_bGutterAtTop = nIntValue != 0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
#ifdef DBG_UTIL
|
#ifdef DBG_UTIL
|
||||||
@@ -885,6 +889,8 @@ bool SettingsTable::GetNoLeading() const
|
|||||||
return m_pImpl->m_bNoLeading;
|
return m_pImpl->m_bNoLeading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SettingsTable::GetGutterAtTop() const { return m_pImpl->m_bGutterAtTop; }
|
||||||
|
|
||||||
}//namespace dmapper
|
}//namespace dmapper
|
||||||
} //namespace writerfilter
|
} //namespace writerfilter
|
||||||
|
|
||||||
|
@@ -94,6 +94,7 @@ public:
|
|||||||
sal_Int32 GetWordCompatibilityMode() const;
|
sal_Int32 GetWordCompatibilityMode() const;
|
||||||
|
|
||||||
const OUString& GetCurrentDatabaseDataSource() const;
|
const OUString& GetCurrentDatabaseDataSource() const;
|
||||||
|
bool GetGutterAtTop() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Properties
|
// Properties
|
||||||
|
Reference in New Issue
Block a user