[Libreoffice-commits] core.git: desktop/source include/sal
desktop/source/lib/init.cxx | 22 ++ include/sal/log-areas.dox |1 + 2 files changed, 23 insertions(+) New commits: commit be7d65019566eba59ec596672d9d25b56e47f748 Author: Tor Lillqvist AuthorDate: Tue Aug 30 14:15:49 2022 +0300 Commit: Tor Lillqvist CommitDate: Tue Aug 30 16:10:42 2022 +0200 Add SAL_INFOs for the recorded and pruned font substitutions Change-Id: Ice7b64c87bff6dbc0eead7bda36f3b0a678986e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139037 Tested-by: Tor Lillqvist Reviewed-by: Tor Lillqvist diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b1691938e3ce..c902af328e0f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2612,6 +2612,17 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, auto aFontMappingUseData = OutputDevice::FinishTrackingFontMappingUse(); +if (aFontMappingUseData.size() > 0) +{ +SAL_INFO("lok.fontsubst", " Original substitutions:"); +for (const auto &i : aFontMappingUseData) +{ +SAL_INFO("lok.fontsubst", i.mOriginalFont); +for (const auto &j : i.mUsedFonts) +SAL_INFO("lok.fontsubst", "" << j); +} +} + // Filter out font substitutions that actually aren't any substitutions, like "Liberation // Serif" -> "Liberation Serif/Regular". If even one of the "substitutions" of a font is to // the same font, don't count that as a missing font. @@ -2647,6 +2658,17 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, } } +if (aFontMappingUseData.size() > 0) +{ +SAL_INFO("lok.fontsubst", " Pruned substitutions:"); +for (const auto &i : aFontMappingUseData) +{ +SAL_INFO("lok.fontsubst", i.mOriginalFont); +for (const auto &j : i.mUsedFonts) +SAL_INFO("lok.fontsubst", "" << j); +} +} + for (std::size_t i = 0; i < aFontMappingUseData.size(); ++i) { pDocument->maFontsMissing.insert(aFontMappingUseData[i].mOriginalFont); diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 543db1db1391..e1c89b1f7df2 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -318,6 +318,7 @@ certain functionality. @section LibreOfficeKit @li @c lok +@li @c lok.fontsubst @li @c lok.tiledrendering @li @c lok.dialog
[Libreoffice-commits] core.git: desktop/source include/sal sal/Library_sal.mk sal/osl
desktop/source/app/sofficemain.cxx |3 ++ include/sal/main.h |7 ++ sal/Library_sal.mk |1 sal/osl/unx/salinit.cxx|6 + sal/osl/unx/signal.cxx | 40 + sal/osl/unx/soffice.cxx| 25 +++ sal/osl/unx/soffice.hxx| 26 sal/osl/w32/salinit.cxx|4 +++ 8 files changed, 74 insertions(+), 38 deletions(-) New commits: commit 629dfff3c7289f185268c7088e67931f6bbd9ce0 Author: Stephan Bergmann AuthorDate: Fri Aug 30 09:16:55 2019 +0200 Commit: Stephan Bergmann CommitDate: Fri Aug 30 14:48:26 2019 +0200 Replace is_soffice_Impl hack with a better(?) hack ...that involves adding a second, one-off special meaning to the existing sal_detail_initialize function. This at least gets rid of the "osl_getExecutableFile contains 'soffice' substring" guesswork (and of the osl_systemPathGetFileNameOrLastDirectoryPart call there, which is what I'm actually after, for a different change to come). Change-Id: I4dd6eef1fd0411bf66943ffea415876c92d08526 Reviewed-on: https://gerrit.libreoffice.org/78291 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index 805c4f07602e..2a692fdae8d4 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -108,6 +109,8 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id, #endif extern "C" int DESKTOP_DLLPUBLIC soffice_main() { +sal_detail_initialize(sal::detail::InitializeSoffice, nullptr); + #if HAVE_FEATURE_BREAKPAD #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID diff --git a/include/sal/main.h b/include/sal/main.h index 9b5ba2b8d69b..d8a87c3e7f61 100644 --- a/include/sal/main.h +++ b/include/sal/main.h @@ -33,6 +33,13 @@ extern "C" { #endif +#if defined LIBO_INTERNAL_ONLY && defined __cplusplus +// Special token for sal_detail_initialize argc parameter, used by the soffice.bin process to tell +// SAL that it is running as part of that process (see sal/osl/unx/soffice.hxx); argv should be null +// in such a sal_detail_initialize call: +namespace sal::detail { constexpr int InitializeSoffice = -1; } +#endif + SAL_DLLPUBLIC void SAL_CALL sal_detail_initialize(int argc, char ** argv); SAL_DLLPUBLIC void SAL_CALL sal_detail_deinitialize(void); diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index a02c333852b7..86f2158f039a 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -175,6 +175,7 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/security \ sal/osl/unx/signal \ sal/osl/unx/socket \ + sal/osl/unx/soffice \ sal/osl/unx/tempfile \ sal/osl/unx/thread \ sal/osl/unx/time \ diff --git a/sal/osl/unx/salinit.cxx b/sal/osl/unx/salinit.cxx index 81a2d02ca31e..9424089dbba0 100644 --- a/sal/osl/unx/salinit.cxx +++ b/sal/osl/unx/salinit.cxx @@ -34,6 +34,7 @@ #include #include "saltime.hxx" +#include "soffice.hxx" #include #if HAVE_SYSLOG_H @@ -45,6 +46,11 @@ extern "C" { void sal_detail_initialize(int argc, char ** argv) { +if (argc == sal::detail::InitializeSoffice) +{ +sal::detail::setSoffice(); +return; +} #if defined MACOSX && !HAVE_FEATURE_MACOSX_SANDBOX // On macOS when not sandboxed, soffice can restart itself via exec (see // restartOnMac in desktop/source/app/app.cxx), which leaves all file diff --git a/sal/osl/unx/signal.cxx b/sal/osl/unx/signal.cxx index 085f14d8ec0c..55d09b4f6249 100644 --- a/sal/osl/unx/signal.cxx +++ b/sal/osl/unx/signal.cxx @@ -23,6 +23,7 @@ #include +#include "soffice.hxx" /* system headers */ #include "system.hxx" @@ -54,8 +55,6 @@ #include #include -#include -#include #include #include #include @@ -155,41 +154,6 @@ bool bSetILLHandler = false; void signalHandlerFunction(int, siginfo_t *, void *); -void getExecutableName_Impl (rtl_String ** ppstrProgName) -{ -rtl_uString* ustrProgFile = nullptr; -osl_getExecutableFile (&ustrProgFile); -if (ustrProgFile) -{ -rtl_uString * ustrProgName = nullptr; -osl_systemPathGetFileNameOrLastDirectoryPart (ustrProgFile, &ustrProgName); -if (ustrProgName != nullptr) -{ -rtl_uString2String ( -ppstrProgName, -rtl_uString_getStr (ustrProgName), rtl_uString_getLength (ustrProgName), -osl_getThreadTextEncoding(), -OUSTRING_TO_OSTRING_CVTFLAGS); -rtl_uString_release (ustrProgName); -} -rtl_uString_release (ustrProgFile); -} -} - -bool is_soffice_Impl() -{ -sal_Int32 idx = -1; -rtl_String*
[Libreoffice-commits] core.git: desktop/source include/sal vcl/inc vcl/quartz
desktop/source/lib/init.cxx |7 -- include/sal/log-areas.dox|1 vcl/inc/quartz/CGHelpers.hxx | 26 - vcl/quartz/salbmp.cxx| 35 vcl/quartz/salgdi.cxx|7 -- vcl/quartz/salgdicommon.cxx | 123 --- vcl/quartz/salgdiutils.cxx |8 -- vcl/quartz/salvd.cxx | 10 --- 8 files changed, 5 insertions(+), 212 deletions(-) New commits: commit 8d16f406e62854df093a7c44c82dff19b0dda130 Author: Tor Lillqvist AuthorDate: Fri Jun 7 08:41:26 2019 +0300 Commit: Tor Lillqvist CommitDate: Fri Jun 7 08:44:05 2019 +0200 Bin the much too verbose SAL_INFO() calls for the "vcl.cg" tag Quikee agreed that they aren't really useful. Doing even the simplest things causes such a huge amount of logging that it is questionable whether anybody could have any use of it. Parts of it might be useful to restore later, if need arises. Like the mnContextStackDepth logging in vcl/inc/quartz/CGHelpers.hxx. Change-Id: If635e6492a50e5955c56c54fa310e7c0ab2986ae Reviewed-on: https://gerrit.libreoffice.org/73639 Tested-by: Jenkins Reviewed-by: Tor Lillqvist diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c1a24ce6c3e0..da37be0570a9 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1624,15 +1624,11 @@ void paintTileIOS(LibreOfficeKitDocument* pThis, nCanvasWidth * 4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little); -// Use the vcl.cg tag even if this code is not in vcl, to match all other SAL_INFO logging about Core Graphics, in vcl. -SAL_INFO("vcl.cg", "CGBitmapContextCreate(" << nCanvasWidth << "x" << nCanvasHeight << "x32) = " << pCGContext); - CGContextTranslateCTM(pCGContext, 0, nCanvasHeight); CGContextScaleCTM(pCGContext, fDPIScale, -fDPIScale); doc_paintTileToCGContext(pThis, (void*) pCGContext, nCanvasWidth, nCanvasHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight); -SAL_INFO("vcl.cg", "CGContextRelease(" << pCGContext << ")"); CGContextRelease(pCGContext); } #endif @@ -4177,8 +4173,6 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW CGContextRef cgc = CGBitmapContextCreate(pBuffer, nWidth, nHeight, 8, nWidth*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little); -SAL_INFO( "vcl.cg", "CGBitmapContextCreate(" << nWidth << "x" << nHeight << "x32) = " << cgc); - CGContextTranslateCTM(cgc, 0, nHeight); CGContextScaleCTM(cgc, fDPIScale, -fDPIScale); @@ -4198,7 +4192,6 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW pWindow->PaintToDevice(pDevice.get(), Point(0, 0), Size()); comphelper::LibreOfficeKit::setDialogPainting(false); -SAL_INFO( "vcl.cg", "CGContextRelease(" << cgc << ")" ); CGContextRelease(cgc); #else diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 904ba74b4425..6af454e1387d 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -459,7 +459,6 @@ certain functionality. @li @c vcl @li @c vcl.a11y @li @c vcl.app -@li @c vcl.cg - CoreGraphics calls on macOS and iOS @li @c vcl.control @li @c vcl.ct - CoreText-using code for macOS and iOS @li @c vcl.debugevent diff --git a/vcl/inc/quartz/CGHelpers.hxx b/vcl/inc/quartz/CGHelpers.hxx index 5d44e835d99b..cbd9a5e785f4 100644 --- a/vcl/inc/quartz/CGHelpers.hxx +++ b/vcl/inc/quartz/CGHelpers.hxx @@ -45,7 +45,6 @@ public: if (mpLayer) { aSize = CGLayerGetSize(mpLayer); -SAL_INFO("vcl.cg", "CGLayerGetSize(" << mpLayer << ") = " << aSize); } return aSize; } @@ -78,24 +77,15 @@ class CGContextHolder { private: CGContextRef mpContext; -#if OSL_DEBUG_LEVEL > 0 -int mnContextStackDepth; -#endif public: CGContextHolder() : mpContext(nullptr) -#if OSL_DEBUG_LEVEL > 0 -, mnContextStackDepth(0) -#endif { } CGContextHolder(CGContextRef pContext) : mpContext(pContext) -#if OSL_DEBUG_LEVEL > 0 -, mnContextStackDepth(0) -#endif { } @@ -105,21 +95,9 @@ public: void set(CGContextRef const& pContext) { mpContext = pContext; } -void saveState() -{ -#if OSL_DEBUG_LEVEL > 0 -SAL_INFO("vcl.cg", "CGContextSaveGState(" << mpContext << ") " << ++mnContextStackDepth); -#endif -CGContextSaveGState(mpContext); -} +void saveState() { CGContextSaveGState(mpContext); } -void restoreState() -{ -#if OSL_DEBUG_LEVEL > 0 -SAL_INFO("vcl.cg", "CGContextRestoreGState(" << mpContext << ") " << mnContextStackDepth--); -#endif -CGContextRestoreGState(mpContext); -} +void restoreSta
[Libreoffice-commits] core.git: desktop/source include/sal
desktop/source/app/updater.cxx | 18 +- include/sal/log-areas.dox |1 + 2 files changed, 10 insertions(+), 9 deletions(-) New commits: commit 1d80281259a51ba961ef44393f6c5de4541e1a59 Author: Stephan Bergmann Date: Tue Nov 21 11:53:01 2017 +0100 Various loplugin warnings in --enable-online-update=mar Change-Id: I5dabd5b65420d30b8d5b631de4d755ecf385b762 Reviewed-on: https://gerrit.libreoffice.org/45027 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 62519aac3469..e34cc6a7cce0 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -69,8 +69,8 @@ static const char kUserAgent[] = "LibreOffice UpdateChecker/1.0 (unknown platfor #endif #ifdef UNX -const char* pUpdaterName = "updater"; -const char* pSofficeExeName = "soffice"; +const char* const pUpdaterName = "updater"; +const char* const pSofficeExeName = "soffice"; #elif defined(WNT) const char* pUpdaterName = "updater.exe"; const char* pSofficeExeName = "soffice.exe"; @@ -105,7 +105,7 @@ OUString normalizePath(const OUString& rPath) return aPath.replaceAll("\\", "/"); } -void CopyFileToDir(const OUString& rTempDirURL, const OUString rFileName, const OUString& rOldDir) +void CopyFileToDir(const OUString& rTempDirURL, const OUString & rFileName, const OUString& rOldDir) { OUString aSourceURL = rOldDir + "/" + rFileName; OUString aDestURL = rTempDirURL + "/" + rFileName; @@ -152,7 +152,7 @@ void createStr(const OUString& rStr, CharT** pArgs, size_t i) #error "Need an implementation" #endif CharT* pStr = new CharT[aStr.getLength() + 1]; -tstrncpy(pStr, (CharT*)aStr.getStr(), aStr.getLength()); +tstrncpy(pStr, aStr.getStr(), aStr.getLength()); pStr[aStr.getLength()] = '\0'; pArgs[i] = pStr; } @@ -328,7 +328,7 @@ bool update() namespace { // Callback to get the response data from server. -static size_t WriteCallback(void *ptr, size_t size, +size_t WriteCallback(void *ptr, size_t size, size_t nmemb, void *userp) { if (!userp) @@ -523,7 +523,7 @@ size_t WriteCallbackFile(void *ptr, size_t size, WriteDataFile* response = static_cast(userp); size_t real_size = size * nmemb; - response->mpStream->WriteBytes(static_cast(ptr), real_size); + response->mpStream->WriteBytes(ptr, real_size); response->maHash.update(static_cast(ptr), real_size); return real_size; } @@ -802,7 +802,7 @@ OUString Updater::getExecutableDirURL() void Updater::log(const OUString& rMessage) { -SAL_INFO("updater", rMessage); +SAL_INFO("desktop.updater", rMessage); OUString aUpdateLog = getUpdateInfoLog(); SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE); aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end @@ -811,7 +811,7 @@ void Updater::log(const OUString& rMessage) void Updater::log(const OString& rMessage) { -SAL_INFO("updater", rMessage); +SAL_INFO("desktop.updater", rMessage); OUString aUpdateLog = getUpdateInfoLog(); SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE); aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end @@ -820,7 +820,7 @@ void Updater::log(const OString& rMessage) void Updater::log(const char* pMessage) { -SAL_INFO("updater", pMessage); +SAL_INFO("desktop.updater", pMessage); OUString aUpdateLog = getUpdateInfoLog(); SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE); aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the end diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 5ca9cf7b8986..1df274126d87 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -167,6 +167,7 @@ certain functionality. @li @c desktop.opengl @li @c desktop.splash @li @c desktop.test +@li @c desktop.updater @section Draw ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source include/sal
desktop/source/app/sofficemain.cxx |8 include/sal/log-areas.dox |1 + 2 files changed, 5 insertions(+), 4 deletions(-) New commits: commit 2bec27302a06268cfd4174e7a0c94198fdbd0ae9 Author: Stephan Bergmann Date: Tue Feb 23 14:19:21 2016 +0100 Various loplugin warnings Change-Id: I6489043ee629e1f411f303c1c43a00975aacf5c4 diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index f78dfd3..abdcd37 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -74,11 +74,11 @@ OString getLibDir() static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* /*context*/, bool succeeded) { // send the minidump to the server (not yet implemented) -SAL_WARN("crashreport", "minidump generated: " << descriptor.path()); +SAL_WARN("destkop.crashreport", "minidump generated: " << descriptor.path()); OString aCommand = getLibDir().copy(7) + "/minidump_upload -p LibreOffice -v \"5.1.0.0\" "; -aCommand = aCommand + descriptor.path() + " " + "http://libreofficecrash.org/submit";; +aCommand = aCommand + descriptor.path() + " http://libreofficecrash.org/submit";; int retVal = std::system(aCommand.getStr()); -SAL_WARN_IF(retVal != 0, "crashreport", "Failed to upload minidump. Error Code: " << retVal); +SAL_WARN_IF(retVal != 0, "destkop.crashreport", "Failed to upload minidump. Error Code: " << retVal); return succeeded; } #endif @@ -91,7 +91,7 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main() #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID google_breakpad::MinidumpDescriptor descriptor("/tmp"); -google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, NULL, true, -1); +google_breakpad::ExceptionHandler eh(descriptor, nullptr, dumpCallback, nullptr, true, -1); #else #endif diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index b4b3184..b83eba7 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -131,6 +131,7 @@ certain functionality. @li @c desktop @li @c desktop.app +@li @c destkop.crashreport @li @c desktop.deployment @li @c desktop.lib @li @c desktop.migration ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits