[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 3 commits - desktop/qa sd/qa sd/source vcl/source
Ashod Nakashian (via logerrit)
logerrit at kemper.freedesktop.org
Tue Sep 3 11:39:09 UTC 2019
desktop/qa/desktop_lib/test_desktop_lib.cxx | 73 +--------------------------
sd/qa/unit/tiledrendering/tiledrendering.cxx | 58 +--------------------
sd/source/ui/sidebar/SlideBackground.cxx | 25 +++++++--
vcl/source/window/dialog.cxx | 26 ++++-----
4 files changed, 40 insertions(+), 142 deletions(-)
New commits:
commit ea6a67be8403a5ef422ab271f249a6f4a1ceeb63
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Nov 11 16:54:59 2018 -0500
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Sep 3 13:38:14 2019 +0200
LOK: disable LOKit in unit-tests only after destroying all
When we disable LOKit at the end of a unit-test, we do so
before any of the smart-pointers go out of scope. These
instances are then destroyed when LOKit is no longer active,
in spite of the fact that they were created while it was.
This leaves some dialog/window routing notifiers dangling,
which cause assertion failures and access-after-free (when
they are invoked on destruction inadvertently). The latter
issue was found with 'make CppunitTest_sd_tiledrendering
VALGRIND=memcheck'.
The fix is to move these flags to the setup and teardown
stages of cpp-unit.
Reviewed-on: https://gerrit.libreoffice.org/68256
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit ccb14cca567dc8bbc17fe0abde01effd08b37d4f)
Change-Id: Ic4481305ca1a5cca14d70a4ebbc820a3fdeea9cc
Reviewed-on: https://gerrit.libreoffice.org/78438
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index eb8cfb605fca..67e66832bbff 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -68,6 +68,8 @@ public:
virtual void setUp() override
{
+ comphelper::LibreOfficeKit::setActive(true);
+
UnoApiTest::setUp();
mxDesktop.set(frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
SfxApplication::GetOrCreate();
@@ -78,9 +80,10 @@ public:
if (m_pDocument)
m_pDocument->pClass->registerCallback(m_pDocument.get(), nullptr, nullptr);
closeDoc();
- comphelper::LibreOfficeKit::setActive(false);
UnoApiTest::tearDown();
+
+ comphelper::LibreOfficeKit::setActive(false);
};
LibLODocument_Impl* loadDoc(const char* pName, LibreOfficeKitDocumentType eType = LOK_DOCTYPE_TEXT);
@@ -341,7 +344,6 @@ void DesktopLOKTest::callbackImpl(int nType, const char* pPayload)
void DesktopLOKTest::testGetStyles()
{
- comphelper::LibreOfficeKit::setActive();
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
boost::property_tree::ptree aTree;
char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:StyleApply");
@@ -376,7 +378,6 @@ void DesktopLOKTest::testGetStyles()
void DesktopLOKTest::testGetFonts()
{
- comphelper::LibreOfficeKit::setActive();
LibLODocument_Impl* pDocument = loadDoc("blank_presentation.odp");
boost::property_tree::ptree aTree;
char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:CharFontName");
@@ -397,7 +398,6 @@ void DesktopLOKTest::testGetFonts()
void DesktopLOKTest::testCreateView()
{
- comphelper::LibreOfficeKit::setActive();
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
CPPUNIT_ASSERT_EQUAL(1, pDocument->m_pDocumentClass->getViewsCount(pDocument));
@@ -423,7 +423,6 @@ void DesktopLOKTest::testCreateView()
void DesktopLOKTest::testGetPartPageRectangles()
{
- comphelper::LibreOfficeKit::setActive();
// Test that we get as many page rectangles as expected: blank document is
// one page.
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
@@ -446,7 +445,6 @@ void DesktopLOKTest::testGetPartPageRectangles()
void DesktopLOKTest::testGetFilterTypes()
{
- comphelper::LibreOfficeKit::setActive();
LibLibreOffice_Impl aOffice;
char* pJSON = aOffice.m_pOfficeClass->getFilterTypes(&aOffice);
@@ -461,8 +459,6 @@ void DesktopLOKTest::testGetFilterTypes()
void DesktopLOKTest::testSearchCalc()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLibreOffice_Impl aOffice;
LibLODocument_Impl* pDocument = loadDoc("search.ods");
pDocument->pClass->initializeForRendering(pDocument, nullptr);
@@ -494,8 +490,6 @@ void DesktopLOKTest::testSearchCalc()
void DesktopLOKTest::testSearchAllNotificationsCalc()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLibreOffice_Impl aOffice;
LibLODocument_Impl* pDocument = loadDoc("search.ods");
pDocument->pClass->initializeForRendering(pDocument, nullptr);
@@ -518,8 +512,6 @@ void DesktopLOKTest::testSearchAllNotificationsCalc()
void DesktopLOKTest::testPaintTile()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
int nCanvasWidth = 100;
int nCanvasHeight = 300;
@@ -546,8 +538,6 @@ void DesktopLOKTest::testPaintTile()
void DesktopLOKTest::testSaveAs()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
@@ -556,8 +546,6 @@ void DesktopLOKTest::testSaveAs()
void DesktopLOKTest::testSaveAsCalc()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("search.ods");
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
@@ -566,8 +554,6 @@ void DesktopLOKTest::testSaveAsCalc()
void DesktopLOKTest::testPasteWriter()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
OString aText("hello");
@@ -605,8 +591,6 @@ void DesktopLOKTest::testPasteWriter()
void DesktopLOKTest::testPasteWriterJPEG()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
OUString aFileURL;
@@ -640,8 +624,6 @@ void DesktopLOKTest::testPasteWriterJPEG()
void DesktopLOKTest::testUndoWriter()
{
// Load a Writer document and press a key.
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 't', 0);
@@ -688,8 +670,6 @@ void DesktopLOKTest::testRowColumnHeaders()
* "size" defines the bottom/right boundary of a row/column in twips (size between 0 and boundary)
* "text" has the header label in UTF-8
*/
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("search.ods");
pDocument->pClass->initializeForRendering(pDocument, nullptr);
@@ -771,8 +751,6 @@ void DesktopLOKTest::testRowColumnHeaders()
void DesktopLOKTest::testHiddenRowHeaders()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("hidden-row.ods");
pDocument->pClass->initializeForRendering(pDocument, nullptr);
@@ -811,8 +789,6 @@ void DesktopLOKTest::testHiddenRowHeaders()
void DesktopLOKTest::testCellCursor()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("search.ods");
boost::property_tree::ptree aTree;
@@ -832,8 +808,6 @@ void DesktopLOKTest::testCellCursor()
void DesktopLOKTest::testCommandResult()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
// the postUnoCommand() is supposed to be async, let's test it safely
@@ -868,8 +842,6 @@ void DesktopLOKTest::testCommandResult()
void DesktopLOKTest::testWriterComments()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
uno::Reference<awt::XReschedule> xToolkit(com::sun::star::awt::Toolkit::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY);
@@ -909,8 +881,6 @@ void DesktopLOKTest::testWriterComments()
void DesktopLOKTest::testTrackChanges()
{
- comphelper::LibreOfficeKit::setActive();
-
// Load a document and create two views.
LibLibreOffice_Impl aOffice;
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
@@ -931,8 +901,6 @@ void DesktopLOKTest::testTrackChanges()
void DesktopLOKTest::testSheetOperations()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("sheets.ods");
// insert the last sheet
@@ -963,8 +931,6 @@ void DesktopLOKTest::testSheetOperations()
void DesktopLOKTest::testSheetSelections()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("sheets.ods", LOK_DOCTYPE_SPREADSHEET);
pDocument->pClass->initializeForRendering(pDocument, nullptr);
pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
@@ -1144,8 +1110,6 @@ namespace {
void DesktopLOKTest::testContextMenuCalc()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("sheet_with_image.ods", LOK_DOCTYPE_SPREADSHEET);
pDocument->pClass->initializeForRendering(pDocument, nullptr);
pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
@@ -1254,8 +1218,6 @@ void DesktopLOKTest::testContextMenuCalc()
void DesktopLOKTest::testContextMenuWriter()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
pDocument->pClass->initializeForRendering(pDocument, nullptr);
pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
@@ -1309,8 +1271,6 @@ void DesktopLOKTest::testContextMenuWriter()
void DesktopLOKTest::testContextMenuImpress()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_presentation.odp", LOK_DOCTYPE_PRESENTATION);
pDocument->pClass->initializeForRendering(pDocument, nullptr);
pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
@@ -1441,8 +1401,6 @@ static void callbackCompressionTest(const int type, const char* payload, void* d
void DesktopLOKTest::testNotificationCompression()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, ¬ifs));
@@ -1529,8 +1487,6 @@ void DesktopLOKTest::testNotificationCompression()
void DesktopLOKTest::testTileInvalidationCompression()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
comphelper::LibreOfficeKit::setPartInInvalidation(true);
@@ -1666,8 +1622,6 @@ void DesktopLOKTest::testTileInvalidationCompression()
void DesktopLOKTest::testPartInInvalidation()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
// No part in invalidation: merge.
{
@@ -1739,8 +1693,6 @@ void DesktopLOKTest::testPartInInvalidation()
void DesktopLOKTest::testRedlineWriter()
{
- comphelper::LibreOfficeKit::setActive();
-
// Load a Writer document, enable change recording and press a key.
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY);
@@ -1769,8 +1721,6 @@ void DesktopLOKTest::testRedlineWriter()
void DesktopLOKTest::testRedlineCalc()
{
// Load a Writer document, enable change recording and press a key.
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("sheets.ods");
uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY);
xPropertySet->setPropertyValue("RecordChanges", uno::makeAny(true));
@@ -1849,8 +1799,6 @@ public:
void DesktopLOKTest::testPaintPartTile()
{
// Load an impress doc of 2 slides.
- comphelper::LibreOfficeKit::setActive();
-
// ViewCallback aView1;
// ViewCallback aView2;
LibLODocument_Impl* pDocument = loadDoc("2slides.odp");
@@ -1892,8 +1840,6 @@ void DesktopLOKTest::testPaintPartTile()
void DesktopLOKTest::testWriterCommentInsertCursor()
{
// Load a document and type a character into the body text of the second view.
- comphelper::LibreOfficeKit::setActive();
-
ViewCallback aView1;
ViewCallback aView2;
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
@@ -1931,8 +1877,6 @@ void DesktopLOKTest::testWriterCommentInsertCursor()
#if HAVE_MORE_FONTS
void DesktopLOKTest::testGetFontSubset()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
OUString aFontName = rtl::Uri::encode(
OUString("Liberation Sans"),
@@ -1955,7 +1899,6 @@ void DesktopLOKTest::testGetFontSubset()
void DesktopLOKTest::testCommentsWriter()
{
- comphelper::LibreOfficeKit::setActive();
// Disable tiled rendering for comments
comphelper::LibreOfficeKit::setTiledAnnotations(false);
@@ -2008,7 +1951,6 @@ void DesktopLOKTest::testCommentsWriter()
void DesktopLOKTest::testCommentsCalc()
{
- comphelper::LibreOfficeKit::setActive();
// Disable tiled rendering for comments
comphelper::LibreOfficeKit::setTiledAnnotations(false);
@@ -2059,7 +2001,6 @@ void DesktopLOKTest::testCommentsCalc()
void DesktopLOKTest::testCommentsImpress()
{
- comphelper::LibreOfficeKit::setActive();
// Disable tiled rendering for comments
comphelper::LibreOfficeKit::setTiledAnnotations(false);
@@ -2115,7 +2056,6 @@ void DesktopLOKTest::testCommentsImpress()
void DesktopLOKTest::testCommentsCallbacksWriter()
{
- comphelper::LibreOfficeKit::setActive();
// Comments callback are emitted only if tiled annotations are off
comphelper::LibreOfficeKit::setTiledAnnotations(false);
ViewCallback aView1;
@@ -2203,8 +2143,6 @@ void DesktopLOKTest::testCommentsCallbacksWriter()
void DesktopLOKTest::testRunMacro()
{
- comphelper::LibreOfficeKit::setActive();
-
LibLibreOffice_Impl aOffice;
bool bGoodMacro, bNonExistentMacro;
@@ -2218,8 +2156,6 @@ void DesktopLOKTest::testRunMacro()
void DesktopLOKTest::testExtractParameter()
{
- comphelper::LibreOfficeKit::setActive();
-
OUString aOptions("Language=de-DE");
OUString aValue = extractParameter(aOptions, "Language");
CPPUNIT_ASSERT_EQUAL(OUString("de-DE"), aValue);
@@ -2346,6 +2282,7 @@ void DesktopLOKTest::testInsertCertificate_DER_ODT()
CPPUNIT_ASSERT_EQUAL(int(1), nState);
}
+
void DesktopLOKTest::testInsertCertificate_PEM_ODT()
{
comphelper::LibreOfficeKit::setActive();
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 6ce5916612b1..0f2cf7bb309b 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -201,6 +201,8 @@ void SdTiledRenderingTest::setUp()
{
test::BootstrapFixture::setUp();
+ comphelper::LibreOfficeKit::setActive(true);
+
mxDesktop.set(css::frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
}
@@ -213,6 +215,7 @@ void SdTiledRenderingTest::tearDown()
xmlBufferFree(m_pXmlBuffer);
comphelper::LibreOfficeKit::setActive(false);
+
test::BootstrapFixture::tearDown();
}
@@ -343,7 +346,6 @@ xmlDocPtr SdTiledRenderingTest::parseXmlDump()
void SdTiledRenderingTest::testRegisterCallback()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -363,7 +365,6 @@ void SdTiledRenderingTest::testRegisterCallback()
void SdTiledRenderingTest::testPostKeyEvent()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -392,7 +393,6 @@ void SdTiledRenderingTest::testPostKeyEvent()
void SdTiledRenderingTest::testPostMouseEvent()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -426,7 +426,6 @@ void SdTiledRenderingTest::testPostMouseEvent()
void SdTiledRenderingTest::testSetTextSelection()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
uno::Reference<container::XIndexAccess> xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -455,7 +454,6 @@ void SdTiledRenderingTest::testSetTextSelection()
void SdTiledRenderingTest::testGetTextSelection()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
uno::Reference<container::XIndexAccess> xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -479,7 +477,6 @@ void SdTiledRenderingTest::testGetTextSelection()
void SdTiledRenderingTest::testSetGraphicSelection()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pPage = pViewShell->GetActualPage();
@@ -515,7 +512,6 @@ void SdTiledRenderingTest::testSetGraphicSelection()
void SdTiledRenderingTest::testUndoShells()
{
- comphelper::LibreOfficeKit::setActive();
// Load a document and set the page size.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
@@ -537,7 +533,6 @@ void SdTiledRenderingTest::testUndoShells()
void SdTiledRenderingTest::testResetSelection()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
uno::Reference<container::XIndexAccess> xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -573,7 +568,6 @@ static void lcl_search(const OUString& rKey, bool bFindAll = false)
void SdTiledRenderingTest::testSearch()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -607,7 +601,6 @@ void SdTiledRenderingTest::testSearch()
void SdTiledRenderingTest::testSearchAll()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -626,7 +619,6 @@ void SdTiledRenderingTest::testSearchAll()
void SdTiledRenderingTest::testSearchAllSelections()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -640,7 +632,6 @@ void SdTiledRenderingTest::testSearchAllSelections()
void SdTiledRenderingTest::testSearchAllNotifications()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -654,7 +645,6 @@ void SdTiledRenderingTest::testSearchAllNotifications()
void SdTiledRenderingTest::testSearchAllFollowedBySearch()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -669,7 +659,6 @@ void SdTiledRenderingTest::testSearchAllFollowedBySearch()
void SdTiledRenderingTest::testDontSearchInMasterPages()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -701,7 +690,6 @@ std::vector<OUString> getCurrentParts(SdXImpressDocument* pDocument)
void SdTiledRenderingTest::testInsertDeletePage()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("insert-delete.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -796,7 +784,6 @@ void SdTiledRenderingTest::testInsertDeletePage()
void SdTiledRenderingTest::testInsertTable()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
@@ -823,7 +810,6 @@ void SdTiledRenderingTest::testInsertTable()
void SdTiledRenderingTest::testPartHash()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pDoc = createDoc("dummy.odp");
int nParts = pDoc->getParts();
@@ -839,7 +825,6 @@ void SdTiledRenderingTest::testPartHash()
void SdTiledRenderingTest::testResizeTable()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("table.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -886,7 +871,6 @@ void SdTiledRenderingTest::testResizeTable()
void SdTiledRenderingTest::testResizeTableColumn()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("table-column.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -1042,8 +1026,6 @@ public:
void SdTiledRenderingTest::testViewCursors()
{
- comphelper::LibreOfficeKit::setActive();
-
// Create two views.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
ViewCallback aView1;
@@ -1070,8 +1052,6 @@ void SdTiledRenderingTest::testViewCursors()
void SdTiledRenderingTest::testViewCursorParts()
{
- comphelper::LibreOfficeKit::setActive();
-
// Create two views.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
ViewCallback aView1;
@@ -1110,8 +1090,6 @@ void SdTiledRenderingTest::testViewCursorParts()
void SdTiledRenderingTest::testCursorViews()
{
- comphelper::LibreOfficeKit::setActive();
-
// Create the first view.
SdXImpressDocument* pXImpressDocument = createDoc("title-shape.odp");
ViewCallback aView1;
@@ -1159,8 +1137,6 @@ void SdTiledRenderingTest::testCursorViews()
void SdTiledRenderingTest::testViewLock()
{
- comphelper::LibreOfficeKit::setActive();
-
// Load a document that has a shape and create two views.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
ViewCallback aView1;
@@ -1189,8 +1165,6 @@ void SdTiledRenderingTest::testViewLock()
void SdTiledRenderingTest::testUndoLimiting()
{
- comphelper::LibreOfficeKit::setActive();
-
// Create the first view.
SdXImpressDocument* pXImpressDocument = createDoc("title-shape.odp");
sd::ViewShell* pViewShell1 = pXImpressDocument->GetDocShell()->GetViewShell();
@@ -1232,8 +1206,6 @@ void SdTiledRenderingTest::testUndoLimiting()
void SdTiledRenderingTest::testCreateViewGraphicSelection()
{
- comphelper::LibreOfficeKit::setActive();
-
// Load a document and register a callback.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
ViewCallback aView1;
@@ -1271,8 +1243,6 @@ void SdTiledRenderingTest::testCreateViewGraphicSelection()
void SdTiledRenderingTest::testCreateViewTextCursor()
{
- comphelper::LibreOfficeKit::setActive();
-
// Load a document and register a callback.
SdXImpressDocument* pXImpressDocument = createDoc("title-shape.odp");
ViewCallback aView1;
@@ -1328,7 +1298,6 @@ void SdTiledRenderingTest::testCreateViewTextCursor()
void SdTiledRenderingTest::testTdf102223()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf102223.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -1369,7 +1338,6 @@ void SdTiledRenderingTest::testTdf102223()
void SdTiledRenderingTest::testPostKeyEventInvalidation()
{
// Load a document and begin text edit on the first slide.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("2slides.odp");
CPPUNIT_ASSERT_EQUAL(0, pXImpressDocument->getPart());
ViewCallback aView1;
@@ -1417,7 +1385,6 @@ void SdTiledRenderingTest::testPostKeyEventInvalidation()
void SdTiledRenderingTest::testTdf103083()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf103083.fodp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -1483,7 +1450,6 @@ void SdTiledRenderingTest::testTdf103083()
void SdTiledRenderingTest::testTdf104405()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf104405.fodp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -1535,7 +1501,6 @@ void SdTiledRenderingTest::testTdf104405()
void SdTiledRenderingTest::testTdf81754()
{
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf81754.pptx");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -1570,7 +1535,6 @@ void SdTiledRenderingTest::testTdf81754()
void SdTiledRenderingTest::testTdf105502()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf105502.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
sd::Window* pWindow = pViewShell->GetActiveWindow();
@@ -1626,7 +1590,6 @@ void SdTiledRenderingTest::testTdf105502()
void SdTiledRenderingTest::testCommentCallbacks()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
// Set the tiled annotations off
comphelper::LibreOfficeKit::setTiledAnnotations(false);
@@ -1741,7 +1704,6 @@ void SdTiledRenderingTest::testCommentCallbacks()
void SdTiledRenderingTest::testMultiViewInsertDeletePage()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
ViewCallback aView1;
int nView1 = SfxLokHelper::getView();
@@ -1787,7 +1749,6 @@ void SdTiledRenderingTest::testMultiViewInsertDeletePage()
void SdTiledRenderingTest::testDisableUndoRepair()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
SfxViewShell* pView1 = SfxViewShell::Current();
int nView1 = SfxLokHelper::getView();
@@ -1841,8 +1802,6 @@ void SdTiledRenderingTest::testDisableUndoRepair()
void SdTiledRenderingTest::testDocumentRepair()
{
- comphelper::LibreOfficeKit::setActive();
-
// Create two views.
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
CPPUNIT_ASSERT(pXImpressDocument);
@@ -1893,7 +1852,6 @@ void SdTiledRenderingTest::testDocumentRepair()
void SdTiledRenderingTest::testLanguageStatus()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
createDoc("dummy.odp");
SfxViewShell* pView1 = SfxViewShell::Current();
SfxLokHelper::createView();
@@ -1915,7 +1873,6 @@ void SdTiledRenderingTest::testLanguageStatus()
void SdTiledRenderingTest::testLanguageAllText()
{
// Load the document, which has a single shape, with Hungarian text.
- comphelper::LibreOfficeKit::setActive();
createDoc("language-all-text.odp");
// Set tha language to English for all text.
@@ -1942,8 +1899,6 @@ void SdTiledRenderingTest::testLanguageAllText()
void SdTiledRenderingTest::testDefaultView()
{
// Load the document with notes view.
- comphelper::LibreOfficeKit::setActive();
-
SdXImpressDocument* pXImpressDocument = createDoc("notes-view.odp");
sd::ViewShell* pView = pXImpressDocument->GetDocShell()->GetViewShell();
{
@@ -1963,8 +1918,6 @@ void SdTiledRenderingTest::testDefaultView()
void SdTiledRenderingTest::testIMESupport()
{
// Load the document with notes view.
- comphelper::LibreOfficeKit::setActive();
-
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
VclPtr<vcl::Window> pDocWindow = pXImpressDocument->getDocWindow();
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
@@ -2002,7 +1955,6 @@ void SdTiledRenderingTest::testIMESupport()
void SdTiledRenderingTest::testTdf115783()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf115783.fodp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -2069,7 +2021,6 @@ void SdTiledRenderingTest::testTdf115783()
void SdTiledRenderingTest::testPasteTextOnSlide()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("paste_text_onslide.odp");
CPPUNIT_ASSERT(pXImpressDocument);
@@ -2131,7 +2082,6 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
void SdTiledRenderingTest::testTdf115873()
{
- comphelper::LibreOfficeKit::setActive();
// Initialize the navigator.
SdXImpressDocument* pXImpressDocument = createDoc("tdf115873.fodp");
SfxViewShell* pViewShell = SfxViewShell::Current();
@@ -2167,7 +2117,6 @@ void SdTiledRenderingTest::testTdf115873()
void SdTiledRenderingTest::testTdf115873Group()
{
- comphelper::LibreOfficeKit::setActive();
// Initialize the navigator.
SdXImpressDocument* pXImpressDocument = createDoc("tdf115873-group.fodp");
SfxViewShell* pViewShell = SfxViewShell::Current();
@@ -2184,7 +2133,6 @@ void SdTiledRenderingTest::testTdf115873Group()
void SdTiledRenderingTest::testCutSelectionChange()
{
// Load the document.
- comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("cut_selection_change.odp");
CPPUNIT_ASSERT(pXImpressDocument);
commit 62b42056603606fe80e9bb21659d7eb57da46767
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Jan 20 12:06:07 2019 -0500
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Sep 3 13:38:02 2019 +0200
LOK: sd: notify LOK of page size/orientation change
Change-Id: I2eb92d83f50b91b39a10e22298d496668c1cbf72
(cherry picked from commit 50731e73a5e6103ba68b8f5a9143cc223d830410)
Reviewed-on: https://gerrit.libreoffice.org/78437
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 945ff195325e..efa6defc1495 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -73,6 +73,7 @@
#include <editeng/lrspitem.hxx>
#include <svl/itemset.hxx>
#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
using namespace ::com::sun::star;
@@ -1003,20 +1004,32 @@ IMPL_LINK_NOARG(SlideBackground, FillStyleModifyHdl, ListBox&, void)
IMPL_LINK_NOARG(SlideBackground, PaperSizeModifyHdl, ListBox&, void)
{
- Paper ePaper = mpPaperSizeBox->GetSelection();
- Size aSize(SvxPaperInfo::GetPaperSize(ePaper, meUnit));
+ const Paper ePaper = mpPaperSizeBox->GetSelection();
+ Size aSize(SvxPaperInfo::GetPaperSize(ePaper, meUnit));
- if(mpPaperOrientation->GetSelectedEntryPos() == 0)
+ if (mpPaperOrientation->GetSelectedEntryPos() == 0)
Swap(aSize);
mpPageItem->SetLandscape(mpPaperOrientation->GetSelectedEntryPos() == 0);
- SvxSizeItem aSizeItem(SID_ATTR_PAGE_SIZE, aSize);
+ const SvxSizeItem aSizeItem(SID_ATTR_PAGE_SIZE, aSize);
// Page/slide properties dialog (FuPage::ExecuteDialog and ::ApplyItemSet) misuses
// SID_ATTR_PAGE_EXT1 to distinguish between Impress and Draw, as for whether to fit
// objects to paper size. Until that is handled somehow better, we do the same here
- SfxBoolItem aFitObjs(SID_ATTR_PAGE_EXT1, IsImpress());
+ const SfxBoolItem aFitObjs(SID_ATTR_PAGE_EXT1, IsImpress());
- GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE, SfxCallMode::RECORD, { &aSizeItem, mpPageItem.get(), &aFitObjs});
+ GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE, SfxCallMode::RECORD,
+ { &aSizeItem, mpPageItem.get(), &aFitObjs });
+
+ // Notify LOK clients of the page size chagne.
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+ while (pViewShell)
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ pViewShell = SfxViewShell::GetNext(*pViewShell);
+ }
+ }
}
IMPL_LINK_NOARG(SlideBackground, FillColorHdl, SvxColorListBox&, void)
commit 9cf5e4c28bba6b93c2fd1e44ce889caa679058c6
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sat Jan 5 09:12:25 2019 -0500
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Sep 3 13:37:49 2019 +0200
vcl: LOK: notify of dialog creation before size change
Notifying the size change of a non-existing dialog is
worse than useless. This also fixes the issue with
positioning dialogs in the center of the client window.
Reviewed-on: https://gerrit.libreoffice.org/66517
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
(cherry picked from commit 1f05243e16eff3849078a47be4e9b49eae9e5954)
Change-Id: I2e8163f4c5a0a09f79ea11c704c250b17a158948
Reviewed-on: https://gerrit.libreoffice.org/78436
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index b95dfb299f41..afc975412186 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -892,6 +892,19 @@ bool Dialog::ImplStartExecute()
std::abort();
}
+ if (bKitActive)
+ {
+ if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+ {
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back("type", "dialog");
+ aItems.emplace_back("size", GetSizePixel().toString());
+ if (!GetText().isEmpty())
+ aItems.emplace_back("title", GetText().toUtf8());
+ pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
+ }
+ }
+
#ifdef DBG_UTIL
vcl::Window* pParent = GetParent();
if ( pParent )
@@ -950,19 +963,6 @@ bool Dialog::ImplStartExecute()
else
UITestLogger::getInstance().log("ModelessDialogExecuted Id:" + get_id());
- if (bKitActive)
- {
- if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
- {
- std::vector<vcl::LOKPayloadItem> aItems;
- aItems.emplace_back("type", "dialog");
- aItems.emplace_back("size", GetSizePixel().toString());
- if (!GetText().isEmpty())
- aItems.emplace_back("title", GetText().toUtf8());
- pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
- }
- }
-
return true;
}
More information about the Libreoffice-commits
mailing list