Kaydet (Commit) 125cbcbe authored tarafından Michael Stahl's avatar Michael Stahl

sw: fix htmlexport test failure

Somehow this test failed on Windows, because of restoring a "NONE" field
unit to SW_MOD()... apparently the "charborder.odt" test is run first,
and preTest() sees a null SW_MOD() then postTest restores a NONE metric.

Hack around that by calling SwGlobals::ensure() to create SW_MOD().

Change-Id: I6c0cda3aae397071bca16bf0e5d9f8105635550f
üst a6e28fe9
......@@ -22,6 +22,8 @@
#include <sfx2/sfxdefs.hxx>
#include <sfx2/module.hxx>
#include <swdllapi.h>
namespace sw { class Filters; }
/**
......@@ -31,7 +33,7 @@ namespace sw { class Filters; }
*/
namespace SwGlobals
{
void ensure();
void SW_DLLPUBLIC ensure();
sw::Filters & getFilters();
}
......
......@@ -51,9 +51,10 @@ private:
else
setFilterOptions("");
if (OString(filename) == "charborder.odt" && SW_MOD())
if (OString(filename) == "charborder.odt")
{
// FIXME if padding-top gets exported as inches, not cms, we get rounding errors.
SwGlobals::ensure(); // make sure that SW_MOD() is not 0
SwMasterUsrPref* pPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(false));
m_eUnit = pPref->GetMetric();
pPref->SetMetric(FUNIT_CM);
......@@ -62,7 +63,7 @@ private:
void postTest(const char* filename) SAL_OVERRIDE
{
if (OString(filename) == "charborder.odt" && SW_MOD())
if (OString(filename) == "charborder.odt")
{
SwMasterUsrPref* pPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(false));
pPref->SetMetric(m_eUnit);
......
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