Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
f8bd9687
Kaydet (Commit)
f8bd9687
authored
Mar 31, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add testcase for sd::Window::LogicInvalidate().
Change-Id: I1d2e6ed9691ca43abb18bdf04fcf5a6c73a66f18
üst
f15a6a06
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
191 additions
and
1 deletion
+191
-1
CppunitTest_sd_tiledrendering.mk
sd/CppunitTest_sd_tiledrendering.mk
+63
-0
Module_sd.mk
sd/Module_sd.mk
+1
-0
dummy.odp
sd/qa/unit/tiledrendering/data/dummy.odp
+0
-0
tiledrendering.cxx
sd/qa/unit/tiledrendering/tiledrendering.cxx
+125
-0
unomodel.hxx
sd/source/ui/inc/unomodel.hxx
+2
-1
No files found.
sd/CppunitTest_sd_tiledrendering.mk
0 → 100644
Dosyayı görüntüle @
f8bd9687
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#*************************************************************************
$(eval $(call gb_CppunitTest_CppunitTest,sd_tiledrendering))
$(eval $(call gb_CppunitTest_add_exception_objects,sd_tiledrendering, \
sd/qa/unit/tiledrendering/tiledrendering \
))
$(eval $(call gb_CppunitTest_use_libraries,sd_tiledrendering, \
comphelper \
cppu \
cppuhelper \
editeng \
sal \
sfx \
svl \
svt \
svxcore \
sd \
test \
unotest \
vcl \
tl \
utl \
$(gb_UWINAPI) \
))
$(eval $(call gb_CppunitTest_use_externals,sd_tiledrendering,\
boost_headers \
libxml2 \
))
$(eval $(call gb_CppunitTest_set_include,sd_tiledrendering,\
-I$(SRCDIR)/sd/inc \
-I$(SRCDIR)/sd/source/ui/inc \
-I$(SRCDIR)/sd/qa/unit \
$$(INCLUDE) \
))
$(eval $(call gb_CppunitTest_use_api,sd_tiledrendering,\
offapi \
udkapi \
))
$(eval $(call gb_CppunitTest_use_ure,sd_tiledrendering))
$(eval $(call gb_CppunitTest_use_vcl,sd_tiledrendering))
$(eval $(call gb_CppunitTest_use_rdb,sd_tiledrendering,services))
$(eval $(call gb_CppunitTest_use_configuration,sd_tiledrendering))
$(call gb_CppunitTest_get_target,sd_tiledrendering) : $(call gb_AllLangResTarget_get_target,sd)
# vim: set noet sw=4 ts=4:
sd/Module_sd.mk
Dosyayı görüntüle @
f8bd9687
...
...
@@ -33,6 +33,7 @@ $(eval $(call gb_Module_add_check_targets,sd,\
CppunitTest_sd_export_tests \
CppunitTest_sd_filters_test \
CppunitTest_sd_html_export_tests \
CppunitTest_sd_tiledrendering \
))
endif
...
...
sd/qa/unit/tiledrendering/data/dummy.odp
0 → 100644
Dosyayı görüntüle @
f8bd9687
File added
sd/qa/unit/tiledrendering/tiledrendering.cxx
0 → 100644
Dosyayı görüntüle @
f8bd9687
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <com/sun/star/frame/Desktop.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <test/bootstrapfixture.hxx>
#include <test/xmltesttools.hxx>
#include <unotest/macros_test.hxx>
#include <DrawDocShell.hxx>
#include <ViewShell.hxx>
#include <unomodel.hxx>
using
namespace
css
;
static
const
char
*
DATA_DIRECTORY
=
"/sd/qa/unit/tiledrendering/data/"
;
class
SdTiledRenderingTest
:
public
test
::
BootstrapFixture
,
public
unotest
::
MacrosTest
,
public
XmlTestTools
{
public
:
virtual
void
setUp
()
SAL_OVERRIDE
;
virtual
void
tearDown
()
SAL_OVERRIDE
;
void
testRegisterCallback
();
CPPUNIT_TEST_SUITE
(
SdTiledRenderingTest
);
#if !defined(WNT) && !defined(MACOSX)
CPPUNIT_TEST
(
testRegisterCallback
);
#endif
CPPUNIT_TEST_SUITE_END
();
private
:
SdXImpressDocument
*
createDoc
(
const
char
*
pName
);
static
void
callback
(
int
nType
,
const
char
*
pPayload
,
void
*
pData
);
void
callbackImpl
(
int
nType
,
const
char
*
pPayload
);
uno
::
Reference
<
lang
::
XComponent
>
mxComponent
;
Rectangle
m_aInvalidation
;
};
void
SdTiledRenderingTest
::
setUp
()
{
test
::
BootstrapFixture
::
setUp
();
mxDesktop
.
set
(
css
::
frame
::
Desktop
::
create
(
comphelper
::
getComponentContext
(
getMultiServiceFactory
())));
}
void
SdTiledRenderingTest
::
tearDown
()
{
if
(
mxComponent
.
is
())
mxComponent
->
dispose
();
test
::
BootstrapFixture
::
tearDown
();
}
SdXImpressDocument
*
SdTiledRenderingTest
::
createDoc
(
const
char
*
pName
)
{
if
(
mxComponent
.
is
())
mxComponent
->
dispose
();
mxComponent
=
loadFromDesktop
(
getURLFromSrc
(
DATA_DIRECTORY
)
+
OUString
::
createFromAscii
(
pName
),
"com.sun.star.presentation.PresentationDocument"
);
SdXImpressDocument
*
pImpressDocument
=
dynamic_cast
<
SdXImpressDocument
*>
(
mxComponent
.
get
());
CPPUNIT_ASSERT
(
pImpressDocument
);
pImpressDocument
->
initializeForTiledRendering
();
return
pImpressDocument
;
}
void
SdTiledRenderingTest
::
callback
(
int
nType
,
const
char
*
pPayload
,
void
*
pData
)
{
static_cast
<
SdTiledRenderingTest
*>
(
pData
)
->
callbackImpl
(
nType
,
pPayload
);
}
void
SdTiledRenderingTest
::
callbackImpl
(
int
nType
,
const
char
*
pPayload
)
{
switch
(
nType
)
{
case
LOK_CALLBACK_INVALIDATE_TILES
:
{
OUString
aPayload
=
OUString
::
createFromAscii
(
pPayload
);
if
(
aPayload
!=
"EMPTY"
&&
m_aInvalidation
.
IsEmpty
())
{
uno
::
Sequence
<
OUString
>
aSeq
=
comphelper
::
string
::
convertCommaSeparated
(
aPayload
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_Int32
>
(
4
),
aSeq
.
getLength
());
m_aInvalidation
.
setX
(
aSeq
[
0
].
toInt32
());
m_aInvalidation
.
setY
(
aSeq
[
1
].
toInt32
());
m_aInvalidation
.
setWidth
(
aSeq
[
2
].
toInt32
());
m_aInvalidation
.
setHeight
(
aSeq
[
3
].
toInt32
());
}
}
break
;
}
}
void
SdTiledRenderingTest
::
testRegisterCallback
()
{
// Tests sd::Window::LogicInvalidate().
SdXImpressDocument
*
pXImpressDocument
=
createDoc
(
"dummy.odp"
);
pXImpressDocument
->
registerCallback
(
&
SdTiledRenderingTest
::
callback
,
this
);
sd
::
ViewShell
*
pViewShell
=
pXImpressDocument
->
GetDocShell
()
->
GetViewShell
();
// Append a character to the empty title shape.
vcl
::
KeyCode
aKeyCode
(
0
,
0
);
KeyEvent
aKeyEvent
(
static_cast
<
sal_Unicode
>
(
'x'
),
aKeyCode
,
0
);
pViewShell
->
KeyInput
(
aKeyEvent
,
0
);
mxComponent
->
dispose
();
// Check that the top left 256x256px tile would be invalidated.
CPPUNIT_ASSERT
(
!
m_aInvalidation
.
IsEmpty
());
Rectangle
aTopLeft
(
0
,
0
,
256
*
15
,
256
*
15
);
// 1 px = 15 twips, assuming 96 DPI.
CPPUNIT_ASSERT
(
m_aInvalidation
.
IsOver
(
aTopLeft
));
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
SdTiledRenderingTest
);
CPPUNIT_PLUGIN_IMPLEMENT
();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sd/source/ui/inc/unomodel.hxx
Dosyayı görüntüle @
f8bd9687
...
...
@@ -50,6 +50,7 @@
#include <editeng/unoipset.hxx>
#include <comphelper/servicehelper.hxx>
#include <sddllapi.h>
class
SdDrawDocument
;
class
SdPage
;
...
...
@@ -65,7 +66,7 @@ extern OUString getPageApiNameFromUiName( const OUString& rUIName );
/***********************************************************************
* *
***********************************************************************/
class
SdXImpressDocument
:
public
SfxBaseModel
,
// implements SfxListener, OWEAKOBJECT & other
class
S
D_DLLPUBLIC
S
dXImpressDocument
:
public
SfxBaseModel
,
// implements SfxListener, OWEAKOBJECT & other
public
SvxFmMSFactory
,
public
::
com
::
sun
::
star
::
drawing
::
XDrawPageDuplicator
,
public
::
com
::
sun
::
star
::
drawing
::
XLayerSupplier
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment