diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-12-02 08:45:26 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-12-02 17:26:33 +0100 |
commit | f36767fde87191258ea21f3faac0be6ad79328e0 (patch) | |
tree | 6a4820a0cb921365f637fd86880fecbae6b877ea /unotest | |
parent | c8e21d246bcb4289cb25c82be440cd07b7418436 (diff) |
PPTX export: handle theme colors from the doc model for shape text
As a start, do this only in case there are no effects used. If there is
no theme color or there are effects, fall back to the old code.
Also move parseExportStream() from SdModelTestBaseXML up to MacrosTest,
so oox/ test code can use it as well.
Change-Id: Ia76581dcef110341f6c3e60f22c34818ed0dcabc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126215
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'unotest')
-rw-r--r-- | unotest/Library_unotest.mk | 1 | ||||
-rw-r--r-- | unotest/source/cpp/macros_test.cxx | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/unotest/Library_unotest.mk b/unotest/Library_unotest.mk index ea697699ee82..3acfe2f69ed9 100644 --- a/unotest/Library_unotest.mk +++ b/unotest/Library_unotest.mk @@ -22,6 +22,7 @@ $(eval $(call gb_Library_use_libraries,unotest,\ cppuhelper \ sal \ sb \ + utl \ )) $(eval $(call gb_Library_use_externals,unotest,\ diff --git a/unotest/source/cpp/macros_test.cxx b/unotest/source/cpp/macros_test.cxx index ab15518e4c9c..718c0b1b8954 100644 --- a/unotest/source/cpp/macros_test.cxx +++ b/unotest/source/cpp/macros_test.cxx @@ -14,6 +14,7 @@ #include <com/sun/star/document/MacroExecMode.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/frame/DispatchHelper.hpp> +#include <com/sun/star/packages/zip/ZipFileAccess.hpp> #include <basic/basrdll.hxx> #include <cppunit/TestAssert.h> @@ -23,6 +24,8 @@ #include <osl/file.hxx> #include <osl/process.h> #include <osl/thread.h> +#include <unotools/tempfile.hxx> +#include <unotools/ucbstreamhelper.hxx> using namespace css; @@ -85,6 +88,20 @@ void MacrosTest::dispatchCommand(const uno::Reference<lang::XComponent>& xCompon xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, rPropertyValues); } +std::unique_ptr<SvStream> MacrosTest::parseExportStream(const utl::TempFile& rTempFile, + const OUString& rStreamName) +{ + const OUString aUrl = rTempFile.GetURL(); + uno::Reference<uno::XComponentContext> xComponentContext + = comphelper::getProcessComponentContext(); + uno::Reference<packages::zip::XZipFileAccess2> const xZipNames( + packages::zip::ZipFileAccess::createWithURL(xComponentContext, aUrl)); + uno::Reference<io::XInputStream> const xInputStream(xZipNames->getByName(rStreamName), + uno::UNO_QUERY); + std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true)); + return pStream; +} + void MacrosTest::setUpNssGpg(const test::Directories& rDirectories, const OUString& rTestName) { OUString aSourceDir = rDirectories.getURLFromSrc(u"/test/signing-keys/"); |