diff options
Diffstat (limited to 'embeddedobj/qa/cppunit/msole.cxx')
-rw-r--r-- | embeddedobj/qa/cppunit/msole.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/embeddedobj/qa/cppunit/msole.cxx b/embeddedobj/qa/cppunit/msole.cxx index 493b5c6a2ca6..6bd849584a4a 100644 --- a/embeddedobj/qa/cppunit/msole.cxx +++ b/embeddedobj/qa/cppunit/msole.cxx @@ -26,6 +26,10 @@ #include <unotools/ucbstreamhelper.hxx> #include <vcl/outdev.hxx> +#ifdef _WIN32 +#include <systools/win32/comtools.hxx> +#endif + using namespace ::com::sun::star; namespace @@ -39,6 +43,20 @@ public: { } }; + +bool IsPaintClassNotRegistered() +{ +#ifdef _WIN32 + sal::systools::CoInitializeGuard g(0); + // Check if MS Paint's {0003000A-0000-0000-C000-000000000046} is registered + CLSID clsidPaint{ 0x0003000A, 0000, 0000, { 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; + LPOLESTR pProgId = nullptr; + if (ProgIDFromCLSID(clsidPaint, &pProgId) == REGDB_E_CLASSNOTREG) + return true; + CoTaskMemFree(pProgId); +#endif + return false; +} } namespace @@ -78,6 +96,9 @@ CPPUNIT_TEST_FIXTURE(Test, testSaveOnThread) return; } + if (IsPaintClassNotRegistered()) + return; + DBG_TESTSOLARMUTEX(); OUString aURL = createFileURL(u"reqif-ole2.xhtml"); uno::Sequence<beans::PropertyValue> aLoadProperties = { |