Related: tdf#113160 set parent of warning dialogs during load
to the new window frame being constructed that (may) contain the progress bar, that way such modal dialogs affect the loading document window and not whatever window happens to be active Change-Id: I1c7d3185e47fa316eef003b80d18b31d341b79d6 Reviewed-on: https://gerrit.libreoffice.org/44269 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
parent
26211f0456
commit
0a09ca614b
@ -282,6 +282,7 @@ 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");
|
||||
@ -311,6 +312,7 @@ void DesktopLOKTest::testGetStyles()
|
||||
CPPUNIT_FAIL("Unknown style family: " + rPair.first);
|
||||
}
|
||||
}
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testGetFonts()
|
||||
@ -337,6 +339,7 @@ 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));
|
||||
|
||||
@ -358,10 +361,12 @@ void DesktopLOKTest::testCreateView()
|
||||
|
||||
pDocument->m_pDocumentClass->destroyView(pDocument, nId1);
|
||||
CPPUNIT_ASSERT_EQUAL(1, pDocument->m_pDocumentClass->getViewsCount(pDocument));
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
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");
|
||||
@ -380,10 +385,12 @@ void DesktopLOKTest::testGetPartPageRectangles()
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aRectangles.size());
|
||||
|
||||
free(pRectangles);
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testGetFilterTypes()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
LibLibreOffice_Impl aOffice;
|
||||
char* pJSON = aOffice.m_pOfficeClass->getFilterTypes(&aOffice);
|
||||
|
||||
@ -394,12 +401,14 @@ void DesktopLOKTest::testGetFilterTypes()
|
||||
CPPUNIT_ASSERT(aTree.size() > 0);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("application/vnd.oasis.opendocument.text"), aTree.get_child("writer8").get_child("MediaType").get_value<std::string>());
|
||||
free(pJSON);
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testSearchCalc()
|
||||
{
|
||||
LibLibreOffice_Impl aOffice;
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLibreOffice_Impl aOffice;
|
||||
LibLODocument_Impl* pDocument = loadDoc("search.ods");
|
||||
pDocument->pClass->initializeForRendering(pDocument, nullptr);
|
||||
pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
|
||||
@ -432,8 +441,9 @@ void DesktopLOKTest::testSearchCalc()
|
||||
|
||||
void DesktopLOKTest::testSearchAllNotificationsCalc()
|
||||
{
|
||||
LibLibreOffice_Impl aOffice;
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLibreOffice_Impl aOffice;
|
||||
LibLODocument_Impl* pDocument = loadDoc("search.ods");
|
||||
pDocument->pClass->initializeForRendering(pDocument, nullptr);
|
||||
pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
|
||||
@ -457,6 +467,8 @@ void DesktopLOKTest::testSearchAllNotificationsCalc()
|
||||
|
||||
void DesktopLOKTest::testPaintTile()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
int nCanvasWidth = 100;
|
||||
int nCanvasHeight = 300;
|
||||
@ -479,27 +491,38 @@ void DesktopLOKTest::testPaintTile()
|
||||
nTileHeight = 4000;
|
||||
aBuffer.resize(nCanvasWidth * nCanvasHeight * 4);
|
||||
pDocument->pClass->paintTile(pDocument, aBuffer.data(), nCanvasWidth, nCanvasHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight);
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testSaveAs()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
utl::TempFile aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "png", nullptr));
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testSaveAsCalc()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("search.ods");
|
||||
utl::TempFile aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "png", nullptr));
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testPasteWriter()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
OString aText("hello");
|
||||
|
||||
@ -521,6 +544,7 @@ void DesktopLOKTest::testPasteWriter()
|
||||
void DesktopLOKTest::testPasteWriterJPEG()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
|
||||
OUString aFileURL;
|
||||
@ -557,6 +581,7 @@ 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);
|
||||
@ -605,6 +630,8 @@ 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);
|
||||
@ -682,10 +709,14 @@ void DesktopLOKTest::testRowColumnHeaders()
|
||||
nPrevious = nSize;
|
||||
}
|
||||
CPPUNIT_ASSERT(!bNotEnoughHeaders);
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testHiddenRowHeaders()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("hidden-row.ods");
|
||||
|
||||
pDocument->pClass->initializeForRendering(pDocument, nullptr);
|
||||
@ -720,10 +751,13 @@ void DesktopLOKTest::testHiddenRowHeaders()
|
||||
}
|
||||
nPrevious = nSize;
|
||||
}
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testCellCursor()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("search.ods");
|
||||
|
||||
boost::property_tree::ptree aTree;
|
||||
@ -738,10 +772,14 @@ void DesktopLOKTest::testCellCursor()
|
||||
|
||||
OString aRectangle(aTree.get<std::string>("commandValues").c_str());
|
||||
CPPUNIT_ASSERT_EQUAL(OString("0, 0, 1279, 255"), aRectangle);
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
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
|
||||
@ -772,11 +810,14 @@ void DesktopLOKTest::testCommandResult()
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(aTree.get_child("commandName").get_value<std::string>(), std::string(".uno:Bold"));
|
||||
CPPUNIT_ASSERT_EQUAL(aTree.get_child("success").get_value<bool>(), true);
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
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);
|
||||
@ -817,9 +858,10 @@ void DesktopLOKTest::testWriterComments()
|
||||
|
||||
void DesktopLOKTest::testTrackChanges()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
// Load a document and create two views.
|
||||
LibLibreOffice_Impl aOffice;
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
pDocument->pClass->initializeForRendering(pDocument, nullptr);
|
||||
pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
|
||||
@ -841,6 +883,7 @@ void DesktopLOKTest::testTrackChanges()
|
||||
void DesktopLOKTest::testSheetOperations()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("sheets.ods");
|
||||
|
||||
// insert the last sheet
|
||||
@ -873,6 +916,7 @@ 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);
|
||||
@ -1053,6 +1097,7 @@ 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);
|
||||
@ -1164,6 +1209,7 @@ 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);
|
||||
@ -1220,6 +1266,7 @@ 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);
|
||||
@ -1351,6 +1398,8 @@ 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));
|
||||
@ -1433,10 +1482,14 @@ void DesktopLOKTest::testNotificationCompression()
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_STATE_CHANGED, std::get<0>(notifs[i]));
|
||||
CPPUNIT_ASSERT_EQUAL(std::string(".uno:AssignLayout=1"), std::get<1>(notifs[i++]));
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testTileInvalidationCompression()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
|
||||
comphelper::LibreOfficeKit::setPartInInvalidation(true);
|
||||
@ -1568,10 +1621,14 @@ void DesktopLOKTest::testTileInvalidationCompression()
|
||||
CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_INVALIDATE_TILES, std::get<0>(notifs[i]));
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 1000000000, 1000000000, 0"), std::get<1>(notifs[i++]));
|
||||
}
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testPartInInvalidation()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
// No part in invalidation: merge.
|
||||
{
|
||||
@ -1639,12 +1696,15 @@ void DesktopLOKTest::testPartInInvalidation()
|
||||
// payload, so this was merged -> it was 1.
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), notifs.size());
|
||||
}
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testRedlineWriter()
|
||||
{
|
||||
// Load a Writer document, enable change recording and press a key.
|
||||
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);
|
||||
xPropertySet->setPropertyValue("RecordChanges", uno::makeAny(true));
|
||||
@ -1674,6 +1734,7 @@ 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));
|
||||
@ -1754,6 +1815,7 @@ void DesktopLOKTest::testPaintPartTile()
|
||||
{
|
||||
// Load an impress doc of 2 slides.
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
ViewCallback aView1;
|
||||
ViewCallback aView2;
|
||||
std::unique_ptr<LibLODocument_Impl> xDocument(loadDoc("2slides.odp"));
|
||||
@ -1793,6 +1855,7 @@ void DesktopLOKTest::testPaintPartTile()
|
||||
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
mxComponent.clear();
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
@ -1800,6 +1863,7 @@ 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;
|
||||
std::unique_ptr<LibLODocument_Impl> xDocument(loadDoc("blank_text.odt"));
|
||||
@ -1833,6 +1897,7 @@ void DesktopLOKTest::testWriterCommentInsertCursor()
|
||||
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
mxComponent.clear();
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
@ -1840,6 +1905,7 @@ void DesktopLOKTest::testWriterCommentInsertCursor()
|
||||
void DesktopLOKTest::testGetFontSubset()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
OUString aFontName = rtl::Uri::encode(
|
||||
OUString("Liberation Sans"),
|
||||
@ -1857,6 +1923,7 @@ void DesktopLOKTest::testGetFontSubset()
|
||||
boost::property_tree::ptree aValues = aTree.get_child("commandValues");
|
||||
CPPUNIT_ASSERT( aValues.size() > 0 );
|
||||
free(pJSON);
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
#endif
|
||||
@ -2114,6 +2181,8 @@ void DesktopLOKTest::testCommentsCallbacksWriter()
|
||||
|
||||
void DesktopLOKTest::testRunMacro()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
LibLibreOffice_Impl aOffice;
|
||||
bool bGoodMacro, bNonExistentMacro;
|
||||
|
||||
@ -2123,10 +2192,14 @@ void DesktopLOKTest::testRunMacro()
|
||||
|
||||
bNonExistentMacro = aOffice.m_pOfficeClass->runMacro(&aOffice, OString("macro:///I.Am.Not(There)").getStr());
|
||||
CPPUNIT_ASSERT(!bNonExistentMacro);
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testExtractParameter()
|
||||
{
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
OUString aOptions("Language=de-DE");
|
||||
OUString aValue = extractParameter(aOptions, "Language");
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("de-DE"), aValue);
|
||||
@ -2151,6 +2224,8 @@ void DesktopLOKTest::testExtractParameter()
|
||||
aValue = extractParameter(aOptions, "Language");
|
||||
CPPUNIT_ASSERT_EQUAL(OUString(), aValue);
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("Something1,Something2=blah,Something3"), aOptions);
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
|
||||
|
@ -1042,17 +1042,32 @@ bool LoadEnv::impl_loadContent()
|
||||
bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), false);
|
||||
bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED(), false);
|
||||
bool bPreview = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW(), false);
|
||||
css::uno::Reference< css::task::XStatusIndicator > xProgress = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STATUSINDICATOR(), css::uno::Reference< css::task::XStatusIndicator >());
|
||||
|
||||
if (!bHidden && !bMinimized && !bPreview && !xProgress.is())
|
||||
if (!bHidden && !bMinimized && !bPreview)
|
||||
{
|
||||
// Note: it's an optional interface!
|
||||
css::uno::Reference< css::task::XStatusIndicatorFactory > xProgressFactory(xTargetFrame, css::uno::UNO_QUERY);
|
||||
if (xProgressFactory.is())
|
||||
css::uno::Reference< css::task::XStatusIndicator > xProgress = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STATUSINDICATOR(), css::uno::Reference< css::task::XStatusIndicator >());
|
||||
if (!xProgress.is())
|
||||
{
|
||||
xProgress = xProgressFactory->createStatusIndicator();
|
||||
if (xProgress.is())
|
||||
m_lMediaDescriptor[utl::MediaDescriptor::PROP_STATUSINDICATOR()] <<= xProgress;
|
||||
// Note: it's an optional interface!
|
||||
css::uno::Reference< css::task::XStatusIndicatorFactory > xProgressFactory(xTargetFrame, css::uno::UNO_QUERY);
|
||||
if (xProgressFactory.is())
|
||||
{
|
||||
xProgress = xProgressFactory->createStatusIndicator();
|
||||
if (xProgress.is())
|
||||
m_lMediaDescriptor[utl::MediaDescriptor::PROP_STATUSINDICATOR()] <<= xProgress;
|
||||
}
|
||||
}
|
||||
if (!comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
//now that we have a window, set things up so that warnings dialogs are relative to that window
|
||||
css::uno::Reference<css::task::XInteractionHandler> xInteractionHandler(
|
||||
task::InteractionHandler::createWithParent(m_xContext, xTargetFrame->getContainerWindow()),
|
||||
css::uno::UNO_QUERY);
|
||||
if (xInteractionHandler.is())
|
||||
{
|
||||
m_lMediaDescriptor[utl::MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= xInteractionHandler;
|
||||
m_lMediaDescriptor[utl::MediaDescriptor::PROP_AUTHENTICATIONHANDLER()] <<= xInteractionHandler;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,11 +125,12 @@ public:
|
||||
4. Default ButtonsOk, MessageError
|
||||
|
||||
@param nErrCodeId error id
|
||||
@param pParent parent window the error dialog will be modal for. nullptr for unrecommended "pick default"
|
||||
@param nFlags error flags.
|
||||
|
||||
@return what sort of dialog to use, with what buttons
|
||||
*/
|
||||
static DialogMask HandleError(ErrCode nId, DialogMask nMask = DialogMask::MAX);
|
||||
static DialogMask HandleError(ErrCode nId, vcl::Window* pParent = nullptr, DialogMask nMask = DialogMask::MAX);
|
||||
static bool GetErrorString(ErrCode nId, OUString& rStr);
|
||||
|
||||
protected:
|
||||
|
@ -189,7 +189,7 @@ bool SwFEShell::InsertRow( sal_uInt16 nCnt, bool bBehind )
|
||||
|
||||
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
|
||||
{
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
|
||||
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
|
||||
return false;
|
||||
}
|
||||
@ -230,7 +230,7 @@ bool SwFEShell::InsertCol( sal_uInt16 nCnt, bool bBehind )
|
||||
|
||||
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
|
||||
{
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
|
||||
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
|
||||
return false;
|
||||
}
|
||||
@ -239,7 +239,7 @@ bool SwFEShell::InsertCol( sal_uInt16 nCnt, bool bBehind )
|
||||
|
||||
if( !CheckSplitCells( *this, nCnt + 1, SwTableSearchType::Col ) )
|
||||
{
|
||||
ErrorHandler::HandleError( ERR_TBLINSCOL_ERROR,
|
||||
ErrorHandler::HandleError( ERR_TBLINSCOL_ERROR, GetWin(),
|
||||
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
|
||||
return false;
|
||||
}
|
||||
@ -285,7 +285,7 @@ bool SwFEShell::DeleteCol()
|
||||
|
||||
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
|
||||
{
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
|
||||
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
|
||||
return false;
|
||||
}
|
||||
@ -336,7 +336,7 @@ bool SwFEShell::DeleteRow(bool bCompleteTable)
|
||||
|
||||
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
|
||||
{
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
|
||||
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
|
||||
return false;
|
||||
}
|
||||
@ -455,7 +455,7 @@ TableMergeErr SwFEShell::MergeTab()
|
||||
const SwTableNode* pTableNd = pTableCursor->GetNode().FindTableNode();
|
||||
if( dynamic_cast< const SwDDETable* >(&pTableNd->GetTable()) != nullptr )
|
||||
{
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
|
||||
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
|
||||
}
|
||||
else
|
||||
@ -486,7 +486,7 @@ bool SwFEShell::SplitTab( bool bVert, sal_uInt16 nCnt, bool bSameHeight )
|
||||
|
||||
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
|
||||
{
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
|
||||
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
|
||||
return false;
|
||||
}
|
||||
@ -495,7 +495,7 @@ bool SwFEShell::SplitTab( bool bVert, sal_uInt16 nCnt, bool bSameHeight )
|
||||
|
||||
if( bVert && !CheckSplitCells( *this, nCnt + 1 ) )
|
||||
{
|
||||
ErrorHandler::HandleError( ERR_TBLSPLIT_ERROR,
|
||||
ErrorHandler::HandleError( ERR_TBLSPLIT_ERROR, GetWin(),
|
||||
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
|
||||
return false;
|
||||
}
|
||||
@ -1295,7 +1295,7 @@ bool SwFEShell::DeleteTableSel()
|
||||
|
||||
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
|
||||
{
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
|
||||
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
|
||||
return false;
|
||||
}
|
||||
@ -2161,7 +2161,7 @@ bool SwFEShell::SetColRowWidthHeight( TableChgWidthHeightType eType, sal_uInt16
|
||||
if( (TableChgWidthHeightType::InsertDeleteMode & eType) &&
|
||||
dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
|
||||
{
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
|
||||
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, GetWin(),
|
||||
DialogMask::MessageInfo | DialogMask::ButtonDefaultsOk );
|
||||
return false;
|
||||
}
|
||||
|
@ -1111,7 +1111,7 @@ UUIInteractionHelper::handleGenericErrorRequest(
|
||||
executeMessageBox(getParentProperty(), aTitle, aErrorString, MessBoxStyle::Ok);
|
||||
}
|
||||
else
|
||||
ErrorHandler::HandleError(nErrorCode);
|
||||
ErrorHandler::HandleError(nErrorCode, getParentProperty());
|
||||
|
||||
if (xApprove.is() && bWarning)
|
||||
xApprove->select();
|
||||
|
@ -108,13 +108,12 @@ bool ErrorHandler::GetErrorString(ErrCode nErrCodeId, OUString& rErrStr)
|
||||
return false;
|
||||
}
|
||||
|
||||
DialogMask ErrorHandler::HandleError(ErrCode nErrCodeId, DialogMask nFlags)
|
||||
DialogMask ErrorHandler::HandleError(ErrCode nErrCodeId, vcl::Window *pParent, DialogMask nFlags)
|
||||
{
|
||||
if (nErrCodeId == ERRCODE_NONE || nErrCodeId == ERRCODE_ABORT)
|
||||
return DialogMask::NONE;
|
||||
|
||||
ErrorRegistry &rData = TheErrorRegistry::get();
|
||||
vcl::Window *pParent = nullptr;
|
||||
ErrorInfo *pInfo = ErrorInfo::GetErrorInfo(nErrCodeId);
|
||||
OUString aAction;
|
||||
|
||||
@ -126,7 +125,7 @@ DialogMask ErrorHandler::HandleError(ErrCode nErrCodeId, DialogMask nFlags)
|
||||
{
|
||||
if(pCtx->GetParent())
|
||||
{
|
||||
pParent=pCtx->GetParent();
|
||||
pParent = pCtx->GetParent();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user