ofz#58942 tweak so fuzzing uses the same defaults as real world writer
I have a looping document which loops in layout in the fuzzer but not in writer but we want easy to reproduce findings rather than load document, ctrl+a, format paragraph and set widow control to 2 Change-Id: I7739a5ebf4eaeac2152afcf8b431c42362374f2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151741 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
@@ -1793,10 +1793,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestPDFExportFODT(SvStream &rStream)
|
|||||||
Reference<css::frame::XLoadable> xModelLoad(xModel, UNO_QUERY_THROW);
|
Reference<css::frame::XLoadable> xModelLoad(xModel, UNO_QUERY_THROW);
|
||||||
xModelLoad->initNew();
|
xModelLoad->initNew();
|
||||||
|
|
||||||
css::uno::Reference<css::frame::XController2> xController(xModel->createDefaultViewController(xTargetFrame), UNO_SET_THROW);
|
|
||||||
|
|
||||||
utl::ConnectFrameControllerModel(xTargetFrame, xController, xModel);
|
|
||||||
|
|
||||||
uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(comphelper::getProcessServiceFactory());
|
uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(comphelper::getProcessServiceFactory());
|
||||||
uno::Reference<io::XInputStream> xStream(new utl::OSeekableInputStreamWrapper(rStream));
|
uno::Reference<io::XInputStream> xStream(new utl::OSeekableInputStreamWrapper(rStream));
|
||||||
uno::Reference<uno::XInterface> xInterface(xMultiServiceFactory->createInstance("com.sun.star.comp.Writer.XmlFilterAdaptor"), uno::UNO_SET_THROW);
|
uno::Reference<uno::XInterface> xInterface(xMultiServiceFactory->createInstance("com.sun.star.comp.Writer.XmlFilterAdaptor"), uno::UNO_SET_THROW);
|
||||||
@@ -1831,6 +1827,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestPDFExportFODT(SvStream &rStream)
|
|||||||
uno::Reference<document::XFilter> xFODTFilter(xInterface, uno::UNO_QUERY_THROW);
|
uno::Reference<document::XFilter> xFODTFilter(xInterface, uno::UNO_QUERY_THROW);
|
||||||
bool ret = xFODTFilter->filter(aArgs);
|
bool ret = xFODTFilter->filter(aArgs);
|
||||||
|
|
||||||
|
css::uno::Reference<css::frame::XController2> xController(xModel->createDefaultViewController(xTargetFrame), UNO_SET_THROW);
|
||||||
|
|
||||||
|
utl::ConnectFrameControllerModel(xTargetFrame, xController, xModel);
|
||||||
|
|
||||||
utl::MediaDescriptor aMediaDescriptor;
|
utl::MediaDescriptor aMediaDescriptor;
|
||||||
aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
|
aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
|
||||||
|
|
||||||
|
@@ -649,7 +649,8 @@ void SwDocShell::SubInitNew()
|
|||||||
//! get lingu options without loading lingu DLL
|
//! get lingu options without loading lingu DLL
|
||||||
SvtLinguOptions aLinguOpt;
|
SvtLinguOptions aLinguOpt;
|
||||||
|
|
||||||
if (!utl::ConfigManager::IsFuzzing())
|
const bool bFuzzing = utl::ConfigManager::IsFuzzing();
|
||||||
|
if (!bFuzzing)
|
||||||
SvtLinguConfig().GetOptions(aLinguOpt);
|
SvtLinguConfig().GetOptions(aLinguOpt);
|
||||||
|
|
||||||
LanguageType nVal = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
|
LanguageType nVal = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
|
||||||
@@ -684,7 +685,7 @@ void SwDocShell::SubInitNew()
|
|||||||
m_xDoc->SetDefaultPageMode( bSquaredPageMode );
|
m_xDoc->SetDefaultPageMode( bSquaredPageMode );
|
||||||
|
|
||||||
// only set Widow/Orphan defaults on a new, non-web document - not an opened one
|
// only set Widow/Orphan defaults on a new, non-web document - not an opened one
|
||||||
if( GetMedium() && GetMedium()->GetOrigURL().isEmpty() )
|
if (GetMedium() && GetMedium()->GetOrigURL().isEmpty() && !bFuzzing)
|
||||||
{
|
{
|
||||||
m_xDoc->SetDefault( SvxWidowsItem( sal_uInt8(2), RES_PARATR_WIDOWS) );
|
m_xDoc->SetDefault( SvxWidowsItem( sal_uInt8(2), RES_PARATR_WIDOWS) );
|
||||||
m_xDoc->SetDefault( SvxOrphansItem( sal_uInt8(2), RES_PARATR_ORPHANS) );
|
m_xDoc->SetDefault( SvxOrphansItem( sal_uInt8(2), RES_PARATR_ORPHANS) );
|
||||||
|
@@ -57,6 +57,10 @@ SwMasterUsrPref::SwMasterUsrPref(bool bWeb) :
|
|||||||
if (utl::ConfigManager::IsFuzzing())
|
if (utl::ConfigManager::IsFuzzing())
|
||||||
{
|
{
|
||||||
m_eHScrollMetric = m_eVScrollMetric = m_eUserMetric = FieldUnit::CM;
|
m_eHScrollMetric = m_eVScrollMetric = m_eUserMetric = FieldUnit::CM;
|
||||||
|
// match defaults
|
||||||
|
SetCore2Option(true, ViewOptCoreFlags2::CursorInProt);
|
||||||
|
SetCore2Option(false, ViewOptCoreFlags2::HiddenPara);
|
||||||
|
m_nDefTabInMm100 = 1250;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
|
MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
|
||||||
|
@@ -281,7 +281,7 @@ SwViewOption::SwViewOption() :
|
|||||||
}
|
}
|
||||||
m_nDivisionX = m_nDivisionY = 1;
|
m_nDivisionX = m_nDivisionY = 1;
|
||||||
|
|
||||||
m_bSelectionInReadonly = !utl::ConfigManager::IsFuzzing() && SW_MOD()->GetAccessibilityOptions().IsSelectionInReadonly();
|
m_bSelectionInReadonly = utl::ConfigManager::IsFuzzing() || SW_MOD()->GetAccessibilityOptions().IsSelectionInReadonly();
|
||||||
|
|
||||||
m_bIdle = true;
|
m_bIdle = true;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user