[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source vcl/workben
desktop/source/splash/splash.cxx | 20 +--- include/vcl/svapp.hxx|2 +- vcl/source/app/brand.cxx |4 ++-- vcl/workben/vcldemo.cxx |2 +- 4 files changed, 9 insertions(+), 19 deletions(-) New commits: commit 6c65c62c26a8aa4d04466545f8f04ec86b797012 Author: Mike Kaganski AuthorDate: Tue Oct 11 09:17:38 2022 +0300 Commit: Mike Kaganski CommitDate: Tue Oct 11 12:45:09 2022 +0200 Don't convert OUString to char* to get OUString in the end Which by the way fixes the mismatch between converting _sAppName to OString as UTF-8 in SplashScreen::SetScreenBitmap, and converting pName to OUString as ASCII in Application::LoadBrandBitmap. Change-Id: I2082f92693ca9633b64411dd668befaa30e978d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141202 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index c3b106cb3b44..1f5461ecaf21 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -472,25 +472,15 @@ void SplashScreen::SetScreenBitmap(BitmapEx ) } // create file name from screen resolution information -OStringBuffer aStrBuf( 128 ); -aStrBuf.append( "intro_" ); +OUString aResBuf = "_" + OUString::number(nWidth) + "x" + OUString::number(nHeight); if ( !_sAppName.isEmpty() ) -{ -aStrBuf.append( OUStringToOString(_sAppName, RTL_TEXTENCODING_UTF8) ); -aStrBuf.append( "_" ); -} -OString aResBuf = OString::number( nWidth ) + "x" + OString::number( nHeight ); - -aStrBuf.append( aResBuf.getStr() ); -if (Application::LoadBrandBitmap (aStrBuf.makeStringAndClear().getStr(), rBitmap)) -return; +if (Application::LoadBrandBitmap(OUStringConcatenation("intro_" + _sAppName + aResBuf), rBitmap)) +return; -aStrBuf.append( "intro_" ); -aStrBuf.append( aResBuf.getStr() ); -if (Application::LoadBrandBitmap (aStrBuf.getStr(), rBitmap)) +if (Application::LoadBrandBitmap(OUStringConcatenation("intro" + aResBuf), rBitmap)) return; -(void)Application::LoadBrandBitmap ("intro", rBitmap); +(void)Application::LoadBrandBitmap (u"intro", rBitmap); } void SplashScreen::determineProgressRatioValues( diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 93dd4873009b..5400157ffa57 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -926,7 +926,7 @@ public: @returns true if the PNG could be loaded, otherwise returns false. */ -static bool LoadBrandBitmap (const char* pName, BitmapEx ); +static bool LoadBrandBitmap (std::u16string_view pName, BitmapEx ); ///@} diff --git a/vcl/source/app/brand.cxx b/vcl/source/app/brand.cxx index 57db30d458e4..15615c35410b 100644 --- a/vcl/source/app/brand.cxx +++ b/vcl/source/app/brand.cxx @@ -52,13 +52,13 @@ namespace { } } -bool Application::LoadBrandBitmap (const char* pName, BitmapEx ) +bool Application::LoadBrandBitmap (std::u16string_view pName, BitmapEx ) { // TODO - if we want more flexibility we could add a branding path // in an rc file perhaps fallback to "about.bmp" OUString aBaseDir( "$BRAND_BASE_DIR"); rtl::Bootstrap::expandMacros( aBaseDir ); -OUString aBaseName( "/" + OUString::createFromAscii( pName ) ); +OUString aBaseName(OUStringChar('/') + pName); OUString aPng( ".png" ); rtl_Locale *pLoc = nullptr; diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index f37a99666143..e6ef740dd6aa 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -141,7 +141,7 @@ public: , mnBounceY(1) #endif { -if (!Application::LoadBrandBitmap("intro", maIntro)) +if (!Application::LoadBrandBitmap(u"intro", maIntro)) Application::Abort("Failed to load intro image"); maIntroBW = maIntro.GetBitmap();
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |7 ++- include/vcl/lok.hxx |4 vcl/source/app/svapp.cxx|8 3 files changed, 18 insertions(+), 1 deletion(-) New commits: commit 53dd6aa5f3817d42bf676980f980051c3b7cdb03 Author: Luboš Luňák AuthorDate: Wed Jun 9 17:11:15 2021 +0200 Commit: Luboš Luňák CommitDate: Wed Jun 9 21:21:45 2021 +0200 scale VCL's scale cache according to the number of Online views If a document is opened in several Online views, each of them using a different zoom, then the scale cache is used for the scaling, and each view is sent updated tiles, so if there are too many views, the cache is not large enough. (Collabora T28503) Change-Id: I3fa719b0515064773fe4584fedbc8aff98e6e213 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116928 Tested-by: Luboš Luňák Reviewed-by: Luboš Luňák diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d509643ce4d1..99e90c5e9ad9 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5275,6 +5275,8 @@ static int doc_createViewWithOptions(LibreOfficeKitDocument* pThis, LibLODocument_Impl* pDocument = static_cast(pThis); const int nId = SfxLokHelper::createView(pDocument->mnDocumentId); + vcl::lok::numberOfViewsChanged(SfxLokHelper::getViewsCount(pDocument->mnDocumentId)); + #ifdef IOS (void) pThis; #else @@ -5289,7 +5291,7 @@ static int doc_createView(LibreOfficeKitDocument* pThis) return doc_createViewWithOptions(pThis, nullptr); // No options. } -static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId) +static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId) { comphelper::ProfileZone aZone("doc_destroyView"); @@ -5299,6 +5301,9 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis LOKClipboardFactory::releaseClipboardForView(nId); SfxLokHelper::destroyView(nId); + +LibLODocument_Impl* pDocument = static_cast(pThis); + vcl::lok::numberOfViewsChanged(SfxLokHelper::getViewsCount(pDocument->mnDocumentId)); } static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId) diff --git a/include/vcl/lok.hxx b/include/vcl/lok.hxx index 9f3f30ab7977..108f46def8aa 100644 --- a/include/vcl/lok.hxx +++ b/include/vcl/lok.hxx @@ -20,6 +20,10 @@ bool VCL_DLLPUBLIC isUnipoll(); void VCL_DLLPUBLIC registerPollCallbacks(LibreOfficeKitPollCallback pPollCallback, LibreOfficeKitWakeCallback pWakeCallback, void* pData); void VCL_DLLPUBLIC unregisterPollCallbacks(); + +// Called to tell VCL that the number of document views has changed, so that VCL +// can adjust e.g. sizes of bitmap caches to scale well with larger number of users. +void VCL_DLLPUBLIC numberOfViewsChanged(int count); } #endif // INCLUDE_VCL_LOK_HXX diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index ecfaa3805bef..79d6dfa9c146 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1711,6 +1711,14 @@ bool isUnipoll() return pSVData && pSVData->mpPollCallback != nullptr; } +void numberOfViewsChanged(int count) +{ +ImplSVData * pSVData = ImplGetSVData(); +auto& rCache = pSVData->maGDIData.maScaleCache; +// Normally the cache size is set to 10, scale according to the number of users. +rCache.setMaxSize(count * 10); +} + } // namespace lok, namespace vcl /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |6 ++ include/vcl/svapp.hxx|1 + vcl/source/window/dialog.cxx |4 3 files changed, 11 insertions(+) New commits: commit a207551215ca4d7445bf129a3f6863418d75383e Author: Henry Castro AuthorDate: Wed Feb 17 16:47:27 2021 -0400 Commit: Henry Castro CommitDate: Wed Mar 3 19:27:41 2021 +0100 lok: add batch mode option to load the document When the LibreOffice Kit is active by default is set to headless mode, with the flag "DialogCancelMode::Silent", according to the documentation it should close the dialog, but it was changed for dialog tunneling. However the dialog tunneling is being deprecated, and in order to not produce any regression, it will be used temporary a new state "DialogCancelMode::LOKSilent", to disable any dialog interactivity. Change-Id: I3b6cce38c37f75dc1b24dda352f6caec19438ff1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111087 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky (cherry picked from commit 5f3fbb019bd79bd57eed94e01bd2202efd9a0c06) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111319 Tested-by: Jenkins Reviewed-by: Henry Castro diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d62ceac29c74..2b56bdb2112d 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2239,6 +2239,12 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, const OUString aDeviceFormFactor = extractParameter(aOptions, u"DeviceFormFactor"); SfxLokHelper::setDeviceFormFactor(aDeviceFormFactor); +const OUString aBatch = extractParameter(aOptions, u"Batch"); +if (!aBatch.isEmpty()) +{ + Application::SetDialogCancelMode(DialogCancelMode::LOKSilent); +} + uno::Sequence aFilterOptions(3); aFilterOptions[0] = css::beans::PropertyValue( "FilterOptions", 0, diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index bfa92cf88321..b0b5a069af4b 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -212,6 +212,7 @@ private: enum class DialogCancelMode { Off, ///< do not automatically cancel dialogs Silent, ///< silently cancel any dialogs +LOKSilent, ///< silently cancel any dialogs (LOK case) Fatal ///< cancel any dialogs by std::abort }; diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 67dc19a7be99..f354e8a32d85 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -950,6 +950,10 @@ bool Dialog::ImplStartExecute() "Dialog \"" << ImplGetDialogText(this) << "\"cancelled in silent mode"); return false; + +case DialogCancelMode::LOKSilent: +return false; + default: // default cannot happen case DialogCancelMode::Fatal: std::abort(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |8 +--- include/vcl/dialoghelper.hxx |2 +- vcl/source/window/dialog.cxx |9 - 3 files changed, 6 insertions(+), 13 deletions(-) New commits: commit 71da8dd7d710f9038586800d3d9ac848d064c911 Author: Caolán McNamara AuthorDate: Fri Feb 26 12:14:03 2021 + Commit: Caolán McNamara CommitDate: Fri Feb 26 20:58:06 2021 +0100 move lok FloatingWindow closing code to vcl Change-Id: I8e2c29e2c6450f79a7b80262f290b6afd13db7f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111627 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 76f08455e3a7..6636254bd7b8 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -127,7 +127,6 @@ #include #include #include -#include #include #include #ifdef IOS @@ -5467,12 +5466,7 @@ static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindo if (nAction == LOK_WINDOW_CLOSE) { -bool bWasDialog = vcl::CloseDialog(pWindow); -if (!bWasDialog) -{ -if (FloatingWindow* pFloatWin = dynamic_cast(pWindow.get())) -pFloatWin->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll); -} +vcl::CloseTopLevel(pWindow); } else if (nAction == LOK_WINDOW_PASTE) { diff --git a/include/vcl/dialoghelper.hxx b/include/vcl/dialoghelper.hxx index 828c21b2af17..549188e00214 100644 --- a/include/vcl/dialoghelper.hxx +++ b/include/vcl/dialoghelper.hxx @@ -23,7 +23,7 @@ VCL_DLLPUBLIC void EndAllDialogs(vcl::Window const* pParent); /* for LibreOffice kit */ VCL_DLLPUBLIC void EnableDialogInput(vcl::Window* pDialog); -VCL_DLLPUBLIC bool CloseDialog(vcl::Window* pDialog); +VCL_DLLPUBLIC void CloseTopLevel(vcl::Window* pDialog); /// Pre-loads all modules containing UI information VCL_DLLPUBLIC void VclBuilderPreload(); } diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index d65ac881aa30..3bfdbe1c4bb4 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -1201,14 +1202,12 @@ namespace vcl } } -bool CloseDialog(vcl::Window* pWindow) +void CloseTopLevel(vcl::Window* pWindow) { if (Dialog* pDialog = dynamic_cast(pWindow)) -{ pDialog->Close(); -return true; -} -return false; +else if (FloatingWindow* pFloatWin = dynamic_cast(pWindow)) +pFloatWin->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |3 +-- include/vcl/builder.hxx |3 --- include/vcl/dialoghelper.hxx |2 ++ vcl/source/window/builder.cxx |7 ++- 4 files changed, 9 insertions(+), 6 deletions(-) New commits: commit 074e969a23be8bf2f5ef21d6997f7a0522c81369 Author: Caolán McNamara AuthorDate: Fri Feb 19 13:00:36 2021 + Commit: Caolán McNamara CommitDate: Fri Feb 19 17:10:51 2021 +0100 move VclBuilder::preload so desktop doesn't need to include that header Change-Id: I72f2b21cb9ac0b39995887afcf41189f2e7ad284 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111219 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 7d8785040964..76f08455e3a7 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -151,7 +151,6 @@ #include #include #include -#include #include #include #include @@ -6300,7 +6299,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char } { // Force load some modules comphelper::ProfileZone aInit("preload modules"); -VclBuilder::preload(); +VclBuilderPreload(); VclAbstractDialogFactory::Create(); } diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index dd75d71b8579..1fe1ef85f243 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -106,9 +106,6 @@ public: return m_sHelpRoot; } -/// Pre-loads all modules containing UI information -static void preload(); - static SymbolType mapStockToSymbol(std::u16string_view icon_name); private: diff --git a/include/vcl/dialoghelper.hxx b/include/vcl/dialoghelper.hxx index f8d9ffee83a0..828c21b2af17 100644 --- a/include/vcl/dialoghelper.hxx +++ b/include/vcl/dialoghelper.hxx @@ -24,6 +24,8 @@ VCL_DLLPUBLIC void EndAllDialogs(vcl::Window const* pParent); /* for LibreOffice kit */ VCL_DLLPUBLIC void EnableDialogInput(vcl::Window* pDialog); VCL_DLLPUBLIC bool CloseDialog(vcl::Window* pDialog); +/// Pre-loads all modules containing UI information +VCL_DLLPUBLIC void VclBuilderPreload(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 2717007b0318..470485c05301 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1483,7 +1484,9 @@ static std::shared_ptr g_pMergedLib = std::make_sharedhttps://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |7 +-- include/vcl/svapp.hxx | 14 +- vcl/source/app/svapp.cxx| 19 +++ 3 files changed, 37 insertions(+), 3 deletions(-) New commits: commit 19c144cd36ccd54d5725b6c45f786e9712ae107c Author: Henry Castro AuthorDate: Fri Dec 25 13:09:00 2020 -0400 Commit: Henry Castro CommitDate: Tue Jan 5 12:21:02 2021 +0100 lok: add missing global notifier Occurs when server shows the "Macro Security Warning" before load the document if enable/disable macros, but there are no instances for document/view/controller yet. So it is required to use the global notifier so it can be sent messages to the client side using the JSDialog framework. Change-Id: I67f15b21cbaf21906b88145f3c5835cf0e1ff79d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108288 Tested-by: Jenkins Reviewed-by: Henry Castro diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 2682f3cf6e1a..6a88eb05701b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2464,11 +2464,14 @@ static void lo_registerCallback (LibreOfficeKit* pThis, { SolarMutexGuard aGuard; +Application* pApp = GetpApp(); +assert(pApp); + LibLibreOffice_Impl* pLib = static_cast(pThis); pLib->maLastExceptionMsg.clear(); -pLib->mpCallback = pCallback; -pLib->mpCallbackData = pData; +pApp->m_pCallback = pLib->mpCallback = pCallback; +pApp->m_pCallbackData = pLib->mpCallbackData = pData; } static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions) diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index b1d7759765c3..bfa92cf88321 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -27,12 +27,14 @@ #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -227,7 +229,7 @@ enum class DialogCancelMode { @see Desktop, ImplSVData */ -class VCL_DLLPUBLIC Application +class VCL_DLLPUBLIC Application : public vcl::ILibreOfficeKitNotifier { public: /** @name Initialization @@ -1319,6 +1321,16 @@ public: bool bMobile = false); static weld::Window* GetFrameWeld(const css::uno::Reference& rWindow); + +// ILibreOfficeKitNotifier +void* m_pCallbackData; +LibreOfficeKitCallback m_pCallback; + +virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, + const OUString& rAction, + const std::vector& rPayload = std::vector()) const override; +virtual void libreOfficeKitViewCallback(int nType, const char* pPayload) const override; + private: DECL_STATIC_LINK( Application, PostEventHandler, void*, void ); }; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index c1cbd6d093ce..4449f38642ca 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -161,6 +161,8 @@ Application::Application() osl_setEnvironment(aVar.pData, aValue.pData); ImplGetSVData()->mpApp = this; +m_pCallbackData = nullptr; +m_pCallback = nullptr; } Application::~Application() @@ -310,6 +312,23 @@ void Application::EndAllPopups() Application::PostUserEvent( LINK( nullptr, ImplSVAppData, ImplEndAllPopupsMsg ) ); } +void Application::notifyWindow(vcl::LOKWindowId /*nLOKWindowId*/, + const OUString& /*rAction*/, + const std::vector& /*rPayload = std::vector()*/) const +{ +} + +void Application::libreOfficeKitViewCallback(int nType, const char* pPayload) const +{ +if (!comphelper::LibreOfficeKit::isActive()) +return; + +if (m_pCallback) +{ +m_pCallback(nType, pPayload, m_pCallbackData); +} +} + namespace { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |2 +- include/vcl/uitest/uiobject.hxx |2 ++ vcl/source/uitest/uiobject.cxx | 33 - 3 files changed, 31 insertions(+), 6 deletions(-) New commits: commit 49667a6950709856b9a1a5d59ca78fdf682a53f4 Author: Szymon Kłos AuthorDate: Thu Sep 17 10:18:23 2020 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 18 13:22:46 2020 +0200 jsdialog: use window only if visible When there is a name conflict we should take currently visible window. Change-Id: Iaccf03a78b083ecaca0ee6aa538674a6de093a4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102903 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102983 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 681ac3b12488..a5c2b7c4ea8b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3736,7 +3736,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned long if (!bIsWeldedDialog) { WindowUIObject aUIObject(pWindow); -std::unique_ptr pUIWindow(aUIObject.get_child(aMap["id"])); +std::unique_ptr pUIWindow(aUIObject.get_visible_child(aMap["id"])); if (pUIWindow) { bool bIsClickAction = false; diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index 7d709a342eb4..750226d20be0 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -125,6 +125,8 @@ public: virtual std::unique_ptr get_child(const OUString& rID) override; +virtual std::unique_ptr get_visible_child(const OUString& rID); + virtual std::set get_children() const override; virtual OUString dumpState() const override; diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 8e3097d7d702..b768a80622d0 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -391,7 +391,7 @@ OUString WindowUIObject::get_type() const namespace { -vcl::Window* findChild(vcl::Window* pParent, const OUString& rID) +vcl::Window* findChild(vcl::Window* pParent, const OUString& rID, bool bRequireVisible = false) { if (!pParent) return nullptr; @@ -403,12 +403,16 @@ vcl::Window* findChild(vcl::Window* pParent, const OUString& rID) for (size_t i = 0; i < nCount; ++i) { vcl::Window* pChild = pParent->GetChild(i); -if (pChild && pChild->get_id() == rID) +if (pChild && pChild->get_id() == rID +&& (!bRequireVisible || pChild->IsVisible())) return pChild; -vcl::Window* pResult = findChild(pChild, rID); -if (pResult) -return pResult; +if (!bRequireVisible || pChild->IsVisible()) +{ +vcl::Window* pResult = findChild(pChild, rID); +if (pResult) +return pResult; +} } return nullptr; @@ -458,6 +462,25 @@ std::unique_ptr WindowUIObject::get_child(const OUString& rID) return aFunction(pWindow); } +std::unique_ptr WindowUIObject::get_visible_child(const OUString& rID) +{ +// in a first step try the real children before moving to the top level parent +// This makes it easier to handle cases with the same ID as there is a way +// to resolve conflicts +vcl::Window* pWindow = findChild(mxWindow.get(), rID, true); +if (!pWindow) +{ +vcl::Window* pDialogParent = get_top_parent(mxWindow.get()); +pWindow = findChild(pDialogParent, rID, true); +} + +if (!pWindow) +throw css::uno::RuntimeException("Could not find child with id: " + rID); + +FactoryFunction aFunction = pWindow->GetUITestFactory(); +return aFunction(pWindow); +} + std::set WindowUIObject::get_children() const { vcl::Window* pDialogParent = get_top_parent(mxWindow.get()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx|6 ++ include/vcl/tabctrl.hxx|3 +++ vcl/source/control/tabctrl.cxx | 18 ++ 3 files changed, 27 insertions(+) New commits: commit fe0176fa4776afb5a2a0a8dc82b8265fb2b2cf31 Author: Szymon Kłos AuthorDate: Wed Mar 4 16:04:08 2020 +0100 Commit: Szymon Kłos CommitDate: Wed May 20 13:10:14 2020 +0200 jsdialog: send tab names Change-Id: Iaae09ec6fc1af0de7f052b89a09ea184a023be70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94182 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94557 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 451f3149d67f..c8fc49c94bf8 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3607,6 +3607,12 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin aMap["VALUE"] = aMap["data"]; pUIWindow->execute(sValue, aMap); } +else if (aMap["cmd"] == "selecttab") +{ +aMap["POS"] = aMap["data"]; + +pUIWindow->execute(sSelectAction, aMap); +} else bIsClickAction = true; } diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx index 8e8315bbff8e..d35f0d76aa8e 100644 --- a/include/vcl/tabctrl.hxx +++ b/include/vcl/tabctrl.hxx @@ -26,6 +26,7 @@ #include #include #include +#include class ImplTabItem; struct ImplTabCtrlData; @@ -185,6 +186,8 @@ public: virtual FactoryFunction GetUITestFactory() const override; virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override; + +virtual boost::property_tree::ptree DumpAsPropertyTree() override; }; class NotebookBar; diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index e5d990f041de..4c7ee7b964d0 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2161,6 +2161,24 @@ FactoryFunction TabControl::GetUITestFactory() const return TabControlUIObject::create; } +boost::property_tree::ptree TabControl::DumpAsPropertyTree() +{ +boost::property_tree::ptree aTree = Control::DumpAsPropertyTree(); + +boost::property_tree::ptree aTabs; +for(auto id : GetPageIDs()) +{ +boost::property_tree::ptree aTab; +aTab.put("text", GetPageText(id)); +aTab.put("id", id); +aTabs.push_back(std::make_pair("", aTab)); +} + +aTree.add_child("tabs", aTabs); + +return aTree; +} + sal_uInt16 NotebookbarTabControlBase::m_nHeaderHeight = 0; IMPL_LINK_NOARG(NotebookbarTabControlBase, OpenMenu, Button*, void) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx|6 include/vcl/field.hxx |2 + include/vcl/toolkit/field.hxx |1 include/vcl/uitest/metricfielduiobject.hxx | 35 + include/vcl/uitest/uiobject.hxx|3 -- vcl/source/control/field.cxx | 23 vcl/source/uitest/uiobject.cxx | 40 + 7 files changed, 108 insertions(+), 2 deletions(-) New commits: commit cb3e249e4dbc851f39bd80dfc7fd076543734c6d Author: Henry Castro AuthorDate: Wed Apr 22 18:22:33 2020 -0400 Commit: Henry Castro CommitDate: Sun May 10 17:36:18 2020 +0200 lok: add MetricFieldUIObject class Add new action "VALUE" to set the value number for metric input controls Change-Id: I5058260c2e1562cfc6d10508d5981d185c5f2212 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92738 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93070 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 86212ed28e8e..1a26cdd20b94 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3568,6 +3568,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin const OUString sTypeAction("TYPE"); const OUString sUpAction("UP"); const OUString sDownAction("DOWN"); +const OUString sValue("VALUE"); try { @@ -3599,6 +3600,11 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin pUIWindow->execute(sClearAction, aMap); pUIWindow->execute(sTypeAction, aMap); } +else if (aMap["cmd"] == "value") +{ +aMap["VALUE"] = aMap["data"]; +pUIWindow->execute(sValue, aMap); +} else bIsClickAction = true; } diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index d9b76c56680d..beb3a30c356f 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -150,6 +150,8 @@ public: sal_Int64 Normalize( sal_Int64 nValue ) const; sal_Int64 Denormalize( sal_Int64 nValue ) const; +virtual voidSetValueFromString(const OUString& rStr); + protected: sal_Int64 mnLastValue; sal_Int64 mnMin; diff --git a/include/vcl/toolkit/field.hxx b/include/vcl/toolkit/field.hxx index bd3e92e13dcc..76c998b22c11 100644 --- a/include/vcl/toolkit/field.hxx +++ b/include/vcl/toolkit/field.hxx @@ -101,6 +101,7 @@ public: virtual voiddispose() override; virtual boost::property_tree::ptree DumpAsPropertyTree() override; +virtual FactoryFunction GetUITestFactory() const override; }; class VCL_DLLPUBLIC MetricBox : public ComboBox, public MetricFormatter diff --git a/include/vcl/uitest/metricfielduiobject.hxx b/include/vcl/uitest/metricfielduiobject.hxx new file mode 100644 index ..a23c555225a0 --- /dev/null +++ b/include/vcl/uitest/metricfielduiobject.hxx @@ -0,0 +1,35 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_VCL_UITEST_METRICFIELDUIOBJECT_HXX +#define INCLUDED_VCL_UITEST_METRICFIELDUIOBJECT_HXX + +#include + +class MetricField; + +class UITEST_DLLPUBLIC MetricFieldUIObject : public SpinFieldUIObject +{ +VclPtr mxMetricField; + +public: +MetricFieldUIObject(const VclPtr& xEdit); +virtual ~MetricFieldUIObject() override; + +virtual void execute(const OUString& rAction, const StringMap& rParameters) override; + +static std::unique_ptr create(vcl::Window* pWindow); + +protected: +virtual OUString get_name() const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index 3de90891015e..2c9a3e36cc60 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -15,7 +15,6 @@ #include #include - #include #include @@ -364,7 +363,7 @@ private: virtual OUString get_name() const override; }; -class SpinFieldUIObject final : public EditUIObject +class SpinFieldUIObject : public EditUIObject { VclPtr mxSpinField; diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index c7d088d643b5..c10e6a409855 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |3 +++ include/vcl/graphicfilter.hxx |2 ++ vcl/source/filter/graphicfilter.cxx | 26 ++ 3 files changed, 31 insertions(+) New commits: commit ad8f4c4432e0c5c052b6f87977d1ad8663debe09 Author: Miklos Vajna AuthorDate: Thu Jul 4 11:57:27 2019 +0200 Commit: Miklos Vajna CommitDate: Thu Jul 4 15:34:56 2019 +0200 vcl lok: pre-load graphic libraries This is needed to be able to load e.g. TIFF files in Online, which does not have code in the chroot since online.git commit ad21717498cc214d5d5d5c0ff378238552137e2f (Avoid copying most code into the chroot jail., 2018-03-10). Change-Id: Ib095191ee690d9da6269878a82b1c6995df50dfa Reviewed-on: https://gerrit.libreoffice.org/75077 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 97ba8d523e28..b014080b4aff 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5038,6 +5038,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char InitVCL(); } +// pre-load all graphic libraries. +GraphicFilter::GetGraphicFilter().preload(); + // pre-load all component libraries. if (!xContext.is()) throw css::uno::DeploymentException("preInit: XComponentContext is not created"); diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx index 69fbc215ba77..b603d3479852 100644 --- a/include/vcl/graphicfilter.hxx +++ b/include/vcl/graphicfilter.hxx @@ -309,6 +309,8 @@ public: ErrCode compressAsPNG(const Graphic& rGraphic, SvStream& rOutputStream); +void preload(); + private: OUStringaFilterPath; FilterConfigCache* pConfig; diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 9742715aa4fd..937ec3cf20e6 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -68,6 +68,8 @@ #include #include #include +#include +#include #include #include @@ -1418,6 +1420,30 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size return aGraphic; } +void GraphicFilter::preload() +{ +sal_Int32 nTokenCount = comphelper::string::getTokenCount(aFilterPath, ';'); +ImpFilterLibCache& rCache = Cache::get(); +static const std::initializer_list aFilterNames = { +"icd", "idx", "ime", "ipb", "ipd", "ips", "ipt", "ipx", "ira", "itg", "iti", +}; + +// Load library for each filter. +for (const auto& rFilterName : aFilterNames) +{ +ImpFilterLibCacheEntry* pFilter = nullptr; +// Look at the library in each element inside the filter path. +for (sal_Int32 i = 0; i < nTokenCount; ++i) +{ +pFilter = rCache.GetFilter(aFilterPath.getToken(i, ';'), SVLIBRARY("gie"), rFilterName); +if (pFilter) +{ +break; +} +} +} +} + ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rIStream, sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, GraphicFilterImportFlags nImportFlags, css::uno::Sequence< css::beans::PropertyValue >* pFilterData, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |6 ++- include/vcl/builder.hxx | 10 + vcl/source/window/builder.cxx | 77 ++ 3 files changed, 64 insertions(+), 29 deletions(-) New commits: commit 707f787cd991f9c59712cd3020d127d09605c792 Author: Michael MeeksDate: Sun Feb 11 00:01:44 2018 +0100 lok: enable pre-loading with Vcl's builder Cache vclbuilder's loaded modules globally & simplify logic. Pre-populate that cache on preload for LOK vs. a somewhat inelegant pre-canned list of dialog libraries. Change-Id: I86d936862a41495fd37908f3ee7eb2e0c363d651 Reviewed-on: https://gerrit.libreoffice.org/49550 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 2165a781725a..f5952665d148 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -98,6 +98,8 @@ #include #include #include +#include +#include #include @@ -3811,7 +3813,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char // 2) comphelper::setProcessServiceFactory(xSFactory); // 3) InitVCL() aService->initialize({css::uno::makeAny("preload")}); - +// Force load some modules +VclBuilder::preload(); +VclAbstractDialogFactory::Create(); preloadData(); // Release Solar Mutex, lo_startmain thread should acquire it. diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index 21a586718e55..68d29903b8c0 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -94,17 +94,13 @@ public: return m_sHelpRoot; } +/// Pre-loads all modules containing UI information +static void preload(); + private: VclBuilder(const VclBuilder&) = delete; VclBuilder& operator=(const VclBuilder&) = delete; -typedef std::map ModuleMap; - -//We store these until the builder is deleted, that way we can use the -//ui-previewer on custom widgets and guarantee the modules they are from -//exist for the duration of the dialog -ModuleMap m_aModuleMap; - //If the toplevel window has any properties which need to be set on it, //but the toplevel is the owner of the builder, then its ctor //has not been completed during the building, so properties for it diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 9223a7eac1a1..becc75d63f41 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1099,6 +1099,49 @@ void VclBuilder::cleanupWidgetOwnScrolling(vcl::Window *pScrollParent, vcl::Wind extern "C" { static void thisModule() {} } #endif +// We store these forever, closing modules is non-ideal from a performance +// perspective, code pages will be freed up by the OS anyway if unused for +// a while in many cases, and this helps us pre-init. +typedef std::map ModuleMap; +static ModuleMap g_aModuleMap; +static osl::Module g_aMergedLib; + +#ifndef SAL_DLLPREFIX +# define SAL_DLLPREFIX "" +#endif + +void VclBuilder::preload() +{ +#ifndef DISABLE_DYNLOADING + +#if ENABLE_MERGELIBS +g_aMergedLibs->loadRelative(, SVLIBRARY("merged")); +#endif +// find -name '*ui*' | xargs grep 'class=".*lo-' | +// sed 's/.*class="//' | sed 's/-.*$//' | sort | uniq +static const char *aWidgetLibs[] = { +"sfxlo", "svtlo", "svxcorelo", "foruilo", +"vcllo", "svxlo", "cuilo", "swlo", +"swuilo", "sclo", "sdlo", "chartcontrollerlo", +"smlo", "scuilo","basctllo", "sduilo", +"scnlo", "xsltdlglo", "pcrlo" // "dbulo" +}; +for (auto & lib : aWidgetLibs) +{ +OUStringBuffer sModuleBuf; +sModuleBuf.append(SAL_DLLPREFIX); +sModuleBuf.append(OUString::createFromAscii(lib)); +sModuleBuf.append(SAL_DLLEXTENSION); +osl::Module* pModule = new osl::Module; +OUString sModule = sModuleBuf.makeStringAndClear(); +if (pModule->loadRelative(, sModule)) +g_aModuleMap.insert(std::make_pair(sModule, std::unique_ptr(pModule))); +else +delete pModule; +} +#endif // DISABLE_DYNLOADING +} + VclPtr VclBuilder::makeObject(vcl::Window *pParent, const OString , const OString , stringmap ) { @@ -1581,40 +1624,32 @@ VclPtr VclBuilder::makeObject(vcl::Window *pParent, const OString & } else { -#ifndef SAL_DLLPREFIX -#define SAL_DLLPREFIX "" -#endif sal_Int32 nDelim = name.indexOf('-'); if (nDelim != -1) { +OUString sFunction(OStringToOUString(OString("make") + name.copy(nDelim+1), RTL_TEXTENCODING_UTF8)); + #ifndef DISABLE_DYNLOADING OUStringBuffer
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx | 11 +++--- include/vcl/window.hxx |7 vcl/source/window/window.cxx | 68 --- 3 files changed, 6 insertions(+), 80 deletions(-) New commits: commit ace646b20ee88fdca2780365039e90cb1542262b Author: Pranav KantDate: Wed Dec 20 17:58:05 2017 +0530 lokdialog: Use Application::Post{Mouse,Key}Event() to post to main thread ... instead of custom machinery there to post to main thread. This also now posts window key events to the main thread instead of processing them on the lok thread. Change-Id: Ided1efb3f237a1838fa50bb8d74752be714c3032 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 670032a18211..f87caa5b0787 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include @@ -2269,10 +2270,10 @@ static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n switch (nType) { case LOK_KEYEVENT_KEYINPUT: -pWindow->LOKKeyInput(aEvent); +Application::PostKeyEvent(VclEventId::WindowKeyInput, pWindow, ); break; case LOK_KEYEVENT_KEYUP: -pWindow->LOKKeyUp(aEvent); +Application::PostKeyEvent(VclEventId::WindowKeyUp, pWindow, ); break; default: assert(false); @@ -2449,13 +2450,13 @@ static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned switch (nType) { case LOK_MOUSEEVENT_MOUSEBUTTONDOWN: -pWindow->LogicMouseButtonDown(aEvent); +Application::PostMouseEvent(VclEventId::WindowMouseButtonDown, pWindow, ); break; case LOK_MOUSEEVENT_MOUSEBUTTONUP: -pWindow->LogicMouseButtonUp(aEvent); +Application::PostMouseEvent(VclEventId::WindowMouseButtonUp, pWindow, ); break; case LOK_MOUSEEVENT_MOUSEMOVE: -pWindow->LogicMouseMove(aEvent); +Application::PostMouseEvent(VclEventId::WindowMouseMove, pWindow, ); break; default: assert(false); diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 0f2bc9024ea3..b7cab1b6dbc9 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1220,13 +1220,6 @@ public: /// Dialog / window tunneling related methods. Size PaintActiveFloatingWindow(VirtualDevice& rDevice) const; -void LogicMouseButtonDown(const MouseEvent& rMouseEvent); -void LogicMouseButtonUp(const MouseEvent& rMouseEvent); -void LogicMouseMove(const MouseEvent& rMouseEvent); - -void LOKKeyInput(const KeyEvent& rKeyEvent); -void LOKKeyUp(const KeyEvent& rKeyEvent); - /** @name Accessibility */ ///@{ diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index efe76df74b7c..cb6b48077c80 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3231,74 +3231,6 @@ VclPtr Window::GetParentWithLOKNotifier() return pWindow; } -struct LOKAsyncEvent -{ -VclPtr mpWindow; -SalEvent mnEvent; -MouseEvent maMouseEvent; -}; - -static void LOKAsyncEventLink( void* pEvent, void* ) -{ -LOKAsyncEvent* pLOKEv = static_cast (pEvent); -if (!pLOKEv->mpWindow->IsDisposed()) -{ -ImplWindowFrameProc(pLOKEv->mpWindow, pLOKEv->mnEvent, >maMouseEvent); -} -delete pLOKEv; -} - -void Window::LogicMouseButtonDown(const MouseEvent& rMouseEvent) -{ -// When we're not doing tiled rendering, then positions must be passed as pixels. -assert(comphelper::LibreOfficeKit::isActive()); - -LOKAsyncEvent* pEv = new LOKAsyncEvent; -pEv->mpWindow = ImplIsFloatingWindow() ? ImplGetBorderWindow() : this; -pEv->mnEvent = SalEvent::ExternalMouseButtonDown; -pEv->maMouseEvent = rMouseEvent; -Application::PostUserEvent( Link (pEv, LOKAsyncEventLink) ); - -} - -void Window::LogicMouseButtonUp(const MouseEvent& rMouseEvent) -{ -// When we're not doing tiled rendering, then positions must be passed as pixels. -assert(comphelper::LibreOfficeKit::isActive()); - -LOKAsyncEvent* pEv = new LOKAsyncEvent; -pEv->mpWindow = ImplIsFloatingWindow() ? ImplGetBorderWindow() : this; -pEv->mnEvent = SalEvent::ExternalMouseButtonUp; -pEv->maMouseEvent = rMouseEvent; -Application::PostUserEvent( Link (pEv, LOKAsyncEventLink) ); -} - -void Window::LogicMouseMove(const MouseEvent& rMouseEvent) -{ -// When we're not doing tiled rendering, then positions must be passed as pixels. -assert(comphelper::LibreOfficeKit::isActive()); - -LOKAsyncEvent* pEv = new LOKAsyncEvent; -pEv->mpWindow = ImplIsFloatingWindow() ? ImplGetBorderWindow() : this; -pEv->mnEvent = SalEvent::ExternalMouseMove; -pEv->maMouseEvent =
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/app/app.cxx |3 ++- desktop/source/app/appinit.cxx |4 include/vcl/svapp.hxx |6 ++ vcl/source/app/svapp.cxx | 12 vcl/source/opengl/OpenGLHelper.cxx |4 5 files changed, 28 insertions(+), 1 deletion(-) New commits: commit 2f57632672fa2cd21c9b0113e7a5f8bd033157c4 Author: Samuel MehrbrodtDate: Mon Oct 17 08:57:46 2016 +0200 Force disable OpenGL in Safe Mode Change-Id: I3f19231d9a9168499d9f9ed970d4da1a69cca36a Reviewed-on: https://gerrit.libreoffice.org/29959 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 6396a23..eb48be0 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2088,8 +2088,9 @@ void Desktop::OpenClients() bool bAllowRecoveryAndSessionManagement = ( !rArgs.IsNoRestore() ) && ( !rArgs.IsHeadless() ); // Enter safe mode if requested -if (rArgs.IsSafeMode() || sfx2::SafeMode::hasFlag()) +if (Application::IsSafeModeEnabled()) { handleSafeMode(); +} #if HAVE_FEATURE_BREAKPAD diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 105ade3..3ea2482 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #include using namespace desktop; @@ -96,6 +97,9 @@ void Desktop::RegisterServices(Reference< XComponentContext > const & context) // interpret command line arguments CommandLineArgs& rCmdLine = GetCommandLineArgs(); +if (rCmdLine.IsSafeMode() || sfx2::SafeMode::hasFlag()) +Application::EnableSafeMode(); + // Headless mode for FAT Office, auto cancels any dialogs that popup if (rCmdLine.IsEventTesting()) Application::EnableEventTestingMode(); diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 4ac5084..2886cb5 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1282,6 +1282,12 @@ public: */ static bool IsEventTestingModeEnabled(); +/** Set safe mode to enabled */ +static void EnableSafeMode(); + +/** Determines if safe mode is enabled */ +static bool IsSafeModeEnabled(); + ///@} /** @name IME Status Window Control diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index b394c53..e1336ab 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1646,6 +1646,18 @@ void Application::EnableEventTestingMode() bEventTestingMode = true; } +static bool bSafeMode = false; + +bool Application::IsSafeModeEnabled() +{ +return bSafeMode; +} + +void Application::EnableSafeMode() +{ +bSafeMode = true; +} + void Application::ShowNativeErrorBox(const OUString& sTitle , const OUString& sMessage) { diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index 45f8f76..f07e7dc 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -1024,6 +1024,10 @@ bool OpenGLHelper::isVCLOpenGLEnabled() else if (officecfg::Office::Common::VCL::UseOpenGL::get()) bEnable = true; +// Force disable in safe mode +if (Application::IsSafeModeEnabled()) +bEnable = false; + bRet = bEnable; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |6 ++ include/vcl/virdev.hxx |6 ++ vcl/source/gdi/virdev.cxx | 14 +- 3 files changed, 9 insertions(+), 17 deletions(-) New commits: commit 2191a11022f657eae5fb21f87dd443ea9228920b Author: Caolán McNamaraDate: Mon Dec 7 13:45:26 2015 + last arg of SetOutputSizePixelScaleOffsetAndBuffer no longer used Change-Id: I65e7e82e46c5751617b00a39df47d864b29b6ce1 Reviewed-on: https://gerrit.libreoffice.org/20441 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8dd6290..8fa8e0e 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -904,11 +904,9 @@ void doc_paintTile (LibreOfficeKitDocument* pThis, boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() ); -boost::shared_array aAlphaBuffer; - pDevice->SetOutputSizePixelScaleOffsetAndBuffer( Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), -aBuffer, aAlphaBuffer); +aBuffer); pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight); @@ -1554,7 +1552,7 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/, aDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); aDevice->SetOutputSizePixelScaleOffsetAndBuffer( Size(nFontWidth, nFontHeight), Fraction(1.0), Point(), -aBuffer, nullptr); +aBuffer); aDevice->DrawText(Point(0,0), aFontName); return pBuffer; diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx index cd6db85..c48f10d 100644 --- a/include/vcl/virdev.hxx +++ b/include/vcl/virdev.hxx @@ -48,8 +48,7 @@ private: SAL_DLLPRIVATE bool InnerImplSetOutputSizePixel( const Size& rNewSize, bool bErase, const basebmp::RawMemorySharedArray ); SAL_DLLPRIVATE bool ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, -const basebmp::RawMemorySharedArray , -const basebmp::RawMemorySharedArray ); +const basebmp::RawMemorySharedArray ); VirtualDevice (const VirtualDevice &) = delete; VirtualDevice & operator= (const VirtualDevice &) = delete; @@ -127,8 +126,7 @@ public: boolSetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize, const Fraction& rScale, const Point& rNewOffset, -const basebmp::RawMemorySharedArray , -const basebmp::RawMemorySharedArray ); +const basebmp::RawMemorySharedArray ); boolSetOutputSize( const Size& rNewSize, bool bErase = true ) { return SetOutputSizePixel( LogicToPixel( rNewSize ), bErase ); } diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index 085237f..af9bbbd 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -394,8 +394,7 @@ void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect ) } bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, -const basebmp::RawMemorySharedArray , -const basebmp::RawMemorySharedArray ) +const basebmp::RawMemorySharedArray ) { if( InnerImplSetOutputSizePixel(rNewSize, bErase, pBuffer) ) { @@ -411,7 +410,7 @@ bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, { mpAlphaVDev = VclPtr::Create(*this, meAlphaFormat); mpAlphaVDev->InnerImplSetOutputSizePixel(rNewSize, bErase, - pAlphaBuffer); + basebmp::RawMemorySharedArray()); } // TODO: copy full outdev state to new one, here. Also needed in outdev2.cxx:DrawOutDev @@ -444,16 +443,13 @@ void VirtualDevice::EnableRTL( bool bEnable ) bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, bool bErase ) { -return ImplSetOutputSizePixel( rNewSize, bErase, basebmp::RawMemorySharedArray(), basebmp::RawMemorySharedArray()); +return
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/app/app.cxx |9 + include/vcl/settings.hxx|6 -- vcl/source/app/settings.cxx |5 + 3 files changed, 6 insertions(+), 14 deletions(-) New commits: commit 99dafea3e56e5d2b559352896a509bf7fa0fdab5 Author: Chris Sherlock chris.sherloc...@gmail.com Date: Wed Jan 22 18:24:55 2014 +1100 Move defines into settings.hxx For some unknown reason, there are a bunch of defines in the middle of Desktop::SystemSettingsChanging() that should really be in include/vcl/settings.hxx. I have now moved DRAG_OPTIONS_ALL into settings.hxx but entirely removed DRAG_OPTIONS_NONE because it is confusing. I also removed it in the one place this combination of options is used in the Desktop class. I have also removed the options DRAG_OPTIONS_OBJECT_* from settings.hxx because they are used nowhere in the code. I have carefully looked through the code and nothing flips bits 0x0004 or 0x0008 on the private member of ImplStyleData's mnDragFullOptions in any way. Basically, it is safe to remove. Change-Id: Icf6268f940cfaed271bd43c977473fecfc726949 Signed-off-by: Stephan Bergmann sberg...@redhat.com diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 8c0fe6a..9b32f6c 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1938,13 +1938,6 @@ void Desktop::SystemSettingsChanging( AllSettings rSettings ) if ( !SvtTabAppearanceCfg::IsInitialized () ) return; -# define DRAGFULL_OPTION_ALL \ - ( DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE \ - | DRAGFULL_OPTION_OBJECTMOVE | DRAGFULL_OPTION_OBJECTSIZE \ - | DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT \ - | DRAGFULL_OPTION_SCROLL ) -# define DRAGFULL_OPTION_NONE ((sal_uInt32)~DRAGFULL_OPTION_ALL) - StyleSettings hStyleSettings = rSettings.GetStyleSettings(); MouseSettings hMouseSettings = rSettings.GetMouseSettings(); @@ -1958,7 +1951,7 @@ void Desktop::SystemSettingsChanging( AllSettings rSettings ) nDragFullOptions |= DRAGFULL_OPTION_ALL; break; case DragFrame: -nDragFullOptions = DRAGFULL_OPTION_NONE; +nDragFullOptions = ((sal_uInt32)~DRAGFULL_OPTION_ALL); break; case DragSystemDep: default: diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 6f670fd..ed9e617 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -388,11 +388,13 @@ private: #define DRAGFULL_OPTION_WINDOWMOVE ((sal_uLong)0x0001) #define DRAGFULL_OPTION_WINDOWSIZE ((sal_uLong)0x0002) -#define DRAGFULL_OPTION_OBJECTMOVE ((sal_uLong)0x0004) -#define DRAGFULL_OPTION_OBJECTSIZE ((sal_uLong)0x0008) #define DRAGFULL_OPTION_DOCKING ((sal_uLong)0x0010) #define DRAGFULL_OPTION_SPLIT ((sal_uLong)0x0020) #define DRAGFULL_OPTION_SCROLL ((sal_uLong)0x0040) +#define DRAGFULL_OPTION_ALL \ +( DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE \ +| DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT \ +| DRAGFULL_OPTION_SCROLL ) #define LOGO_DISPLAYTIME_STARTTIME ((sal_uLong)0x) diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 8f2d0c1..fe1456b 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -221,10 +221,7 @@ ImplStyleData::ImplStyleData() : mnScreenZoom= 100; mnScreenFontZoom= 100; mnLogoDisplayTime = LOGO_DISPLAYTIME_STARTTIME; -mnDragFullOptions = DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE | - DRAGFULL_OPTION_OBJECTMOVE | DRAGFULL_OPTION_OBJECTSIZE | - DRAGFULL_OPTION_DOCKING| DRAGFULL_OPTION_SPLIT | - DRAGFULL_OPTION_SCROLL; +mnDragFullOptions = DRAGFULL_OPTION_ALL; mnAnimationOptions = 0; mnSelectionOptions = 0; mnDisplayOptions= 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/app/app.cxx |4 ++-- include/vcl/svapp.hxx |2 ++ vcl/source/app/svapp.cxx | 17 + 3 files changed, 17 insertions(+), 6 deletions(-) New commits: commit 4959f369d9bdcc2ab50cd4a70ad96a4a4fa17c76 Author: Chris Sherlock chris.sherloc...@gmail.com Date: Wed Jan 22 18:45:19 2014 +1100 Improve settings code reability Application::SetSettings relies on Application::GetSettings to initialize the application's settings if this hasn't happened. This means that GetSettings is being used not to get the app's settings, but to initialize the settings! I have corrected this by introducing a private static function InitSettings(). Note that I assert if it attempts to initialize already initialized settings, because the (Get|Set)Settings does the check for you. Also changed a local variable from nGet to nDragMode in Desktop::SystemSettingsChanging to make it easier to read the code. Whilst this is minor, a variable name of nGet seems very sloppy. Change-Id: I04975217c2028b3489179997db4287957578cc93 Reviewed-on: https://gerrit.libreoffice.org/7586 Reviewed-by: Norbert Thiebaud nthieb...@gmail.com Tested-by: Norbert Thiebaud nthieb...@gmail.com diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 962e2b4..8c0fe6a 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1951,8 +1951,8 @@ void Desktop::SystemSettingsChanging( AllSettings rSettings ) sal_uInt32 nDragFullOptions = hStyleSettings.GetDragFullOptions(); SvtTabAppearanceCfg aAppearanceCfg; -sal_uInt16 nGet = aAppearanceCfg.GetDragMode(); -switch ( nGet ) +sal_uInt16 nDragMode = aAppearanceCfg.GetDragMode(); +switch ( nDragMode ) { case DragFullWindow: nDragFullOptions |= DRAGFULL_OPTION_ALL; diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 8e7b053..f0e9b80 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -780,6 +780,8 @@ public: private: +static void InitSettings(); + DECL_STATIC_LINK( Application, PostEventHandler, void* ); }; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index a754856..ac13c73 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -519,7 +519,7 @@ void Application::SetSettings( const AllSettings rSettings ) ImplSVData* pSVData = ImplGetSVData(); if ( !pSVData-maAppData.mpSettings ) { -GetSettings(); +InitSettings(); *pSVData-maAppData.mpSettings = rSettings; ResMgr::SetDefaultLocale( rSettings.GetUILanguageTag() ); } @@ -618,14 +618,23 @@ const AllSettings Application::GetSettings() ImplSVData* pSVData = ImplGetSVData(); if ( !pSVData-maAppData.mpSettings ) { -pSVData-maAppData.mpCfgListener = new LocaleConfigurationListener; -pSVData-maAppData.mpSettings = new AllSettings(); - pSVData-maAppData.mpSettings-GetSysLocale().GetOptions().AddListener( pSVData-maAppData.mpCfgListener ); +InitSettings(); } return *(pSVData-maAppData.mpSettings); } +void Application::InitSettings() +{ +ImplSVData* pSVData = ImplGetSVData(); + +assert(!pSVData-maAppData.mpSettings); // initialization should not happen twice! + +pSVData-maAppData.mpCfgListener = new LocaleConfigurationListener; +pSVData-maAppData.mpSettings = new AllSettings(); +pSVData-maAppData.mpSettings-GetSysLocale().GetOptions().AddListener( pSVData-maAppData.mpCfgListener ); +} + void Application::NotifyAllWindows( DataChangedEvent rDCEvt ) { ImplSVData* pSVData = ImplGetSVData(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits