Kaydet (Commit) c4381413 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#87922 testcase

Change-Id: I71afd42a1825b44e885485051e56a1c1fb81b0c4
Reviewed-on: https://gerrit.libreoffice.org/17620Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 31937624
......@@ -74,6 +74,8 @@
#include "com/sun/star/text/TextMarkupType.hpp"
#include <osl/file.hxx>
#include <paratr.hxx>
#include <drawfont.hxx>
#include <txtfrm.hxx>
#include <editeng/svxenum.hxx>
#include <comphelper/propertysequence.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
......@@ -151,6 +153,7 @@ public:
void testTdf89954();
void testTdf89720();
void testTdf88986();
void testTdf87922();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
......@@ -218,6 +221,7 @@ public:
CPPUNIT_TEST(testTdf89954);
CPPUNIT_TEST(testTdf89720);
CPPUNIT_TEST(testTdf88986);
CPPUNIT_TEST(testTdf87922);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -2223,6 +2227,32 @@ void SwUiWriterTest::testTdf88986()
CPPUNIT_ASSERT(aSet.HasItem(SID_COLOR_TABLE));
}
void SwUiWriterTest::testTdf87922()
{
// Create an SwDrawTextInfo.
SwDoc* pDoc = createDoc("tdf87922.odt");
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
SwScriptInfo* pScriptInfo = 0;
// Get access to the single paragraph in the document.
SwNodeIndex aNodeIndex(pDoc->GetNodes().GetEndOfContent(), -1);
const OUString& rText = aNodeIndex.GetNode().GetTextNode()->GetText();
sal_Int32 nIndex = 0;
sal_Int32 nLength = rText.getLength();
SwDrawTextInfo aDrawTextInfo(pWrtShell, *pWrtShell->GetOut(), pScriptInfo, rText, nIndex, nLength);
// Root -> page -> body -> text.
SwTextFrm* pTextFrm = static_cast<SwTextFrm*>(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower());
aDrawTextInfo.SetFrm(pTextFrm);
// If no color background color is found, assume white.
Color* pColor = sw::GetActiveRetoucheColor();
*pColor = Color(COL_WHITE);
// Make sure that automatic color on black background is white, not black.
vcl::Font aFont;
aDrawTextInfo.ApplyAutoColor(&aFont);
CPPUNIT_ASSERT_EQUAL(COL_WHITE, aFont.GetColor().GetColor());
}
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();
......
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