desktop/source/app/app.cxx | 35 ++++++++++++++++++++++------------- vcl/source/app/svapp.cxx | 13 ++++++++++--- vcl/source/fontsubset/sft.cxx | 6 ++++-- 3 files changed, 36 insertions(+), 18 deletions(-)
New commits: commit 3a03ee49e7cced375decefd336294632180414e4 Author: Caolán McNamara <caol...@redhat.com> Date: Sat Oct 10 12:52:58 2015 +0100 afl-eventtesting: there is no focused/active window in headless mode so close all open frames, not just the active one and send events to the first discovered visible window and not the focus window Change-Id: I7339bc6743cd3106ceddea049136796121819eb3 diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 79b3c86..a3b436d 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1282,23 +1282,32 @@ unsigned int persist_cnt; //the application post start-up for ui-testing void Desktop::CloseFrameAndReopen(Reference<XDesktop2> xDesktop) { - Reference<css::frame::XFrame> xFrame = xDesktop->getActiveFrame(); - Reference<css::frame::XDispatchProvider> xProvider(xFrame, css::uno::UNO_QUERY); + css::uno::Reference<css::container::XIndexAccess> xTaskContainer( + xDesktop->getFrames(), css::uno::UNO_QUERY_THROW); + sal_Int32 c = xTaskContainer->getCount(); + for (sal_Int32 i = 0; i < c; ++i) + { + css::uno::Reference< css::frame::XFrame > xFrame; + xTaskContainer->getByIndex(i) >>= xFrame; + if (!xFrame.is()) + continue; + Reference<css::frame::XDispatchProvider> xProvider(xFrame, css::uno::UNO_QUERY); - css::uno::Reference<css::frame::XController > xController = xFrame->getController(); - css::uno::Reference<css::frame::XModel> xModel = xController->getModel(); - css::uno::Reference< css::util::XModifiable > xModifiable(xModel, css::uno::UNO_QUERY); - xModifiable->setModified(false); + css::uno::Reference<css::frame::XController > xController = xFrame->getController(); + css::uno::Reference<css::frame::XModel> xModel = xController->getModel(); + css::uno::Reference< css::util::XModifiable > xModifiable(xModel, css::uno::UNO_QUERY); + xModifiable->setModified(false); - css::util::URL aCommand; - aCommand.Complete = ".uno:CloseDoc"; + css::util::URL aCommand; + aCommand.Complete = ".uno:CloseDoc"; - css::uno::Reference<css::uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext(); - Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create(xContext); - xParser->parseStrict(aCommand); + css::uno::Reference<css::uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext(); + Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create(xContext); + xParser->parseStrict(aCommand); - css::uno::Reference< css::frame::XDispatch > xDispatch = xProvider->queryDispatch(aCommand, OUString(), 0); - xDispatch->dispatch(aCommand, css::uno::Sequence< css::beans::PropertyValue >()); + css::uno::Reference< css::frame::XDispatch > xDispatch = xProvider->queryDispatch(aCommand, OUString(), 0); + xDispatch->dispatch(aCommand, css::uno::Sequence< css::beans::PropertyValue >()); + } OpenDefault(); } diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index a583307..1d92469 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -347,9 +347,16 @@ namespace { bool InjectKeyEvent(SvStream& rStream) { - VclPtr<vcl::Window> xWin(Application::GetFocusWindow()); - if (!xWin) - xWin.reset(Application::GetActiveTopWindow()); + if (Application::AnyInput()) + return false; + + VclPtr<vcl::Window> xWin(Application::GetFirstTopLevelWindow()); + while (xWin) + { + if (xWin->IsVisible()) + break; + xWin.reset(Application::GetNextTopLevelWindow(xWin)); + } if (!xWin) return false; commit b78d4c6503ff47177316685aae79cb5eaf55e33a Author: Caolán McNamara <caol...@redhat.com> Date: Sat Oct 10 12:27:32 2015 +0100 valgrind: zero padding bytes uninitialized memory warnings on --convert-to pdf of ooo115771-3.doc Change-Id: I2dac6fe29d23d6e25c2f1d1511886d8b585e498c diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 171d910..ac999a6 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -2631,8 +2631,10 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID) if (length > 0) { const sal_uInt8* srcptr = glyf + ttf->goffsets[glyphID]; - d->ptr = static_cast<sal_uInt8*>(malloc((length + 1) & ~1)); assert(d->ptr != 0); - memcpy( d->ptr, srcptr, length ); + const size_t nChunkLen = ((length + 1) & ~1); + d->ptr = static_cast<sal_uInt8*>(malloc(nChunkLen)); assert(d->ptr != 0); + memcpy(d->ptr, srcptr, length); + memset(d->ptr + length, 0, nChunkLen - length); d->compflag = (GetInt16( srcptr, 0, 1 ) < 0); } else { d->ptr = 0;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits