summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2016-08-17 12:30:11 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-08-18 02:39:15 +0200
commita06a8ecb743aa3ffb1be83fbb98f7aa06bc230cb (patch)
tree809f84ee32f53fde168d3e02015c34534a84241d
parentce6cbf86a5e4e23404a6102d18bb7433a64531d1 (diff)
screenshots: fix sc screenshot testfeature/dialog-screenshots
Seems to need a new document Change-Id: I644d2fcb9fe4ec66e964192d3dda61ca331acece
-rw-r--r--sc/qa/unit/screenshots/data/empty.odsbin6873 -> 0 bytes
-rw-r--r--sc/qa/unit/screenshots/screenshots.cxx23
-rw-r--r--vcl/source/window/tabdlg.cxx1
3 files changed, 15 insertions, 9 deletions
diff --git a/sc/qa/unit/screenshots/data/empty.ods b/sc/qa/unit/screenshots/data/empty.ods
deleted file mode 100644
index 14b4232189f5..000000000000
--- a/sc/qa/unit/screenshots/data/empty.ods
+++ /dev/null
Binary files differ
diff --git a/sc/qa/unit/screenshots/screenshots.cxx b/sc/qa/unit/screenshots/screenshots.cxx
index c52bbc533eaf..97fa0af03c47 100644
--- a/sc/qa/unit/screenshots/screenshots.cxx
+++ b/sc/qa/unit/screenshots/screenshots.cxx
@@ -42,7 +42,6 @@
#include <scitems.hxx>
using namespace css;
-static const char* DATA_DIRECTORY = "/sc/qa/unit/screenshots/data/";
class ScScreenshotTest : public ScreenshotTest
{
@@ -53,11 +52,11 @@ private:
ScDocShellRef mxDocSh;
ScTabViewShell* mpViewShell;
ScAbstractDialogFactory* mpFact;
- std::unique_ptr<ScImportStringStream> mpStream;
+ std::unique_ptr<SvMemoryStream> mpStream;
std::unique_ptr<SfxItemSet> mpItemSet;
/// helper
- void initializeWithDoc(const char* pName);
+ void initialize();
/// helper method to populate KnownDialogs, called in setUp(). Needs to be
/// written and has to add entries to KnownDialogs
@@ -72,11 +71,9 @@ public:
virtual ~ScScreenshotTest();
void testOpeningModalDialogs();
- //void testOpeningModelessDialogs();
CPPUNIT_TEST_SUITE(ScScreenshotTest);
CPPUNIT_TEST(testOpeningModalDialogs);
- //CPPUNIT_TEST(testOpeningModelessDialogs);
CPPUNIT_TEST_SUITE_END();
};
@@ -95,11 +92,12 @@ ScScreenshotTest::~ScScreenshotTest()
{
}
-void ScScreenshotTest::initializeWithDoc(const char* pName)
+void ScScreenshotTest::initialize()
{
if (mxComponent.is())
mxComponent->dispose();
- mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY) + OUString::createFromAscii(pName), "com.sun.star.sheet.SpreadsheetDocument");
+ // use new, epty doc to avoid file locking
+ mxComponent = loadFromDesktop("private:factory/scalc", "com.sun.star.sheet.SpreadsheetDocument");
mpFoundShell = SfxObjectShell::GetShellFromComponent(mxComponent);
CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", mpFoundShell);
@@ -114,7 +112,14 @@ void ScScreenshotTest::initializeWithDoc(const char* pName)
CPPUNIT_ASSERT_MESSAGE("Failed to create dialog factory", mpFact);
const OUString aCsv("some, strings, here, separated, by, commas");
- mpStream.reset(new ScImportStringStream(aCsv));
+ SvMemoryStream* pNewMemStream = new SvMemoryStream(const_cast<sal_Unicode *>(aCsv.getStr()), aCsv.getLength() * sizeof(sal_Unicode), StreamMode::READ);
+ pNewMemStream->SetStreamCharSet( RTL_TEXTENCODING_UNICODE );
+ #ifdef OSL_BIGENDIAN
+ pNewMemStream->SetEndian(SvStreamEndian::BIG);
+ #else
+ pNewMemStream->SetEndian(SvStreamEndian::LITTLE);
+ #endif
+ mpStream.reset(pNewMemStream);
}
void ScScreenshotTest::registerKnownDialogsByID(mapType& rKnownDialogs)
@@ -273,7 +278,7 @@ VclAbstractDialog* ScScreenshotTest::createDialogByID(sal_uInt32 nID)
void ScScreenshotTest::testOpeningModalDialogs()
{
- initializeWithDoc("empty.ods");
+ initialize();
/// process input file containing the UXMLDescriptions of the dialogs to dump
processDialogBatchFile("sc/qa/unit/screenshots/data/screenshots.txt");
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index 335c00c22244..99da7cc242ce 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -21,6 +21,7 @@
#include <vcl/layout.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/tabdlg.hxx>
+#include <vcl/tabpage.hxx>
#include <tools/rc.h>
void TabDialog::ImplInitTabDialogData()