Kaydet (Commit) 7b3c07a7 authored tarafından Miklos Vajna's avatar Miklos Vajna

RTF filter: export \hyphauto

Change-Id: Ide8cb5f45d3eb60c45d86d58a9ab12bbc9f4cf47
üst 830abf30
{\rtf1
\hyphauto1
\pard\plain
Hello.
\par
}
......@@ -867,6 +867,11 @@ DECLARE_RTFEXPORT_TEST(testSautoupd, "sautoupd.rtf")
CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xHeading2, "IsAutoUpdate"));
}
DECLARE_RTFEXPORT_TEST(testHyphauto, "hyphauto.rtf")
{
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getParagraph(1), "ParaIsHyphenation"));
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -36,6 +36,7 @@
#include <lineinfo.hxx>
#include <swmodule.hxx>
#include <IDocumentLayoutAccess.hxx>
#include <IDocumentStylePoolAccess.hxx>
#include "ww8par.hxx"
#include <comphelper/string.hxx>
#include <svtools/rtfkeywd.hxx>
......@@ -45,6 +46,7 @@
#include <iostream>
#endif
#include <svx/xflclit.hxx>
#include <editeng/hyphenzoneitem.hxx>
using namespace ::com::sun::star;
......@@ -502,6 +504,17 @@ void RtfExport::ExportDocument_Impl()
WriteInfo();
// Default TabSize
Strm().WriteCharPtr(m_pAttrOutput->m_aTabStop.makeStringAndClear().getStr()).WriteCharPtr(SAL_NEWLINE_STRING);
// Automatic hyphenation: it's a global setting in Word, it's a paragraph setting in Writer.
// Use the setting from the default style.
SwTxtFmtColl* pTxtFmtColl = pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool(RES_POOLCOLL_STANDARD, /*bRegardLanguage=*/false);
const SfxPoolItem* pItem;
if (pTxtFmtColl && pTxtFmtColl->GetItemState(RES_PARATR_HYPHENZONE, false, &pItem) == SfxItemState::SET)
{
Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_HYPHAUTO);
OutULong(static_cast<const SvxHyphenZoneItem*>(pItem)->IsHyphen());
}
// Zoom
SwViewShell* pViewShell(pDoc->getIDocumentLayoutAccess().GetCurrentViewShell());
if (pViewShell && pViewShell->GetViewOptions()->GetZoomType() == SvxZoomType::PERCENT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment