svx/source/xml/xmlgrhlp.cxx | 12 ++++++++++++ vcl/source/filter/graphicfilter.cxx | 1 + xmloff/source/core/xmlexp.cxx | 4 ++++ 3 files changed, 17 insertions(+)
New commits: commit b0cb139e4fab79f8c818cf7f13f526486692cd03 Author: Dr. David Alan Gilbert <[email protected]> AuthorDate: Sat May 24 23:52:31 2025 +0100 Commit: David Gilbert <[email protected]> CommitDate: Fri Jun 13 22:04:49 2025 +0200 tdf#162826: Add logging in save flow Add some more logging for the save flow that I needed to figure out how PDF save worked. Change-Id: Ic82a68220ac65802bdebfedee8b628c8c6123e3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185755 Tested-by: Jenkins Reviewed-by: David Gilbert <[email protected]> diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index e6cc29db7bfa..34ee300c4fd2 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -654,6 +654,7 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X { Graphic aGraphic(rxGraphic); + SAL_INFO("svx", "implSaveGraphic: entry"); auto aIterator = maExportGraphics.find(aGraphic); if (aIterator != maExportGraphics.end()) { @@ -670,6 +671,7 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X OUString aExtension; bool bUseGfxLink = true; + SAL_INFO("svx", "implSaveGraphic: Type!=None"); if (aGfxLink.GetDataSize()) { switch (aGfxLink.GetType()) @@ -719,6 +721,7 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X } else { + SAL_INFO("svx", "implSaveGraphic: Link !size"); if (aGraphicObject.GetType() == GraphicType::Bitmap) { if (aGraphicObject.IsAnimated()) @@ -738,6 +741,8 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X } } + SAL_INFO("svx", "implSaveGraphic: Extension:" << aExtension); + OUString rPictureStreamName; if (!rRequestName.empty()) { @@ -797,14 +802,17 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(aStream.xStream)); if (bUseGfxLink && aGfxLink.GetDataSize() && aGfxLink.GetData()) { + SAL_INFO("svx", "implSaveGraphic: link"); pStream->WriteBytes(aGfxLink.GetData(), aGfxLink.GetDataSize()); rOutSavedMimeType = aMimeType; bSuccess = (pStream->GetError() == ERRCODE_NONE); } else { + SAL_INFO("svx", "implSaveGraphic: !link"); if (aGraphic.GetType() == GraphicType::Bitmap) { + SAL_INFO("svx", "implSaveGraphic: !link - Bitmap"); GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); OUString aFormat; @@ -822,6 +830,7 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X } else if (aGraphic.GetType() == GraphicType::GdiMetafile) { + SAL_INFO("svx", "implSaveGraphic: !link - Gdi"); pStream->SetVersion(SOFFICE_FILEFORMAT_8); pStream->SetCompressMode(SvStreamCompressFlags::ZBITMAP); rOutSavedMimeType = comphelper::GraphicMimeTypeHelper::GetMimeTypeForExtension("svm"); @@ -850,6 +859,7 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X bSuccess = (pStream->GetError() == ERRCODE_NONE); } } + SAL_INFO("svx", "implSaveGraphic: (mid)"); if (!bSuccess) return OUString(); @@ -864,6 +874,8 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X // put into cache maExportGraphics[aGraphic] = std::make_pair(aStoragePath, rOutSavedMimeType); + SAL_INFO("svx", "implSaveGraphic: exit: Path: " << aStoragePath << + " Mime: " << rOutSavedMimeType); return aStoragePath; } diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 61b0a95ee9ba..2f2ca2fb1be7 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1557,6 +1557,7 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, std::u16string_vi Graphic aGraphic = ImpGetScaledGraphic( rGraphic, aConfigItem ); eType = aGraphic.GetType(); + SAL_INFO("vcl.filter", "GraphicFilter::ExportGraphic() Filter: " << aFilterName); if( pConfig->IsExportPixelFormat( nFormat ) ) { if( eType != GraphicType::Bitmap ) diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 4d77d6bc26db..40ab5dc5010a 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1905,6 +1905,8 @@ OUString SvXMLExport::AddEmbeddedXGraphic(uno::Reference<graphic::XGraphic> cons Graphic aGraphic(rxGraphic); const OUString& aOriginURL = aGraphic.getOriginURL(); + SAL_INFO("xmloff.core", "AddEmbeddedXGraphic (entry): rOutMimeType: " << rOutMimeType << + " OriginURL:" << aOriginURL); if (!aOriginURL.isEmpty()) { sURL = GetRelativeReference(aOriginURL); @@ -1917,6 +1919,8 @@ OUString SvXMLExport::AddEmbeddedXGraphic(uno::Reference<graphic::XGraphic> cons sURL = mxGraphicStorageHandler->saveGraphicByName(rxGraphic, rOutMimeType, rRequestedName); } } + SAL_INFO("xmloff.core", "AddEmbeddedXGraphic (exit): rOutMimeType: " << rOutMimeType << + " OriginURL:" << aOriginURL << " sURL:" << sURL); return sURL; }
