[Libreoffice-commits] core.git: include/vcl vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Mar 14 09:41:34 UTC 2019


 include/vcl/gdimtf.hxx    |    2 +-
 vcl/source/gdi/gdimtf.cxx |    5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit e717722d7ff05f0125ae18dc12779f4276155ff6
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Mar 14 09:11:44 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Mar 14 10:41:09 2019 +0100

    vcl: avoid OUString defaulted parameter in GDIMetaFile::dumpAsXml()
    
    So that it's possible to do ad-hoc dumping from gdb with something like:
    
    print xMetaFile->dumpAsXml(0)
    
    Similar to how that already worked for SwDoc or SwFrame.
    
    Change-Id: I9cb884491f2a49afdb06179d8d54252101f37bb7
    Reviewed-on: https://gerrit.libreoffice.org/69253
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 9b43cd2f6ef8..661caf863a22 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -199,7 +199,7 @@ public:
     bool            GetUseCanvas() const { return m_bUseCanvas; }
 
     /// Dumps the meta actions as XML in metafile.xml.
-    void dumpAsXml( const OUString& sFileName = OUString() ) const;
+    void dumpAsXml(const char* pFileName = nullptr) const;
 };
 
 #endif // INCLUDED_VCL_GDIMTF_HXX
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 0aa29bf55173..355744aa3dad 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2835,9 +2835,10 @@ void GDIMetaFile::UseCanvas( bool _bUseCanvas )
     m_bUseCanvas = _bUseCanvas;
 }
 
-void GDIMetaFile::dumpAsXml( const OUString& sFileName ) const
+void GDIMetaFile::dumpAsXml(const char* pFileName) const
 {
-    SvFileStream aStream(sFileName.isEmpty() ? "metafile.xml" : sFileName, StreamMode::STD_READWRITE | StreamMode::TRUNC);
+    SvFileStream aStream(pFileName ? OUString::fromUtf8(pFileName) : OUString("metafile.xml"),
+            StreamMode::STD_READWRITE | StreamMode::TRUNC);
     MetafileXmlDump aDumper;
     aDumper.dump(*this, aStream);
 }


More information about the Libreoffice-commits mailing list