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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 14 15:40:17 UTC 2019


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

New commits:
commit 99ccad6fa5eab2e69fa8c43db3b27b8c02ad8217
Author:     Arkadiy Illarionov <qarkai at gmail.com>
AuthorDate: Sat Jan 12 18:20:51 2019 +0300
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jan 14 16:40:02 2019 +0100

    Fix loop conditions
    
    2b88f6d32f572792597ccbb15276b9db52db7d10 follow-up
    
    Change-Id: I3b525506ee222c80ff04ea38eec90a581c928985
    Reviewed-on: https://gerrit.libreoffice.org/66216
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index ef9fe0137e6a..bfea212bd7cc 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1827,7 +1827,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
     std::unique_ptr<ScUndoRemoveMerge> pUndoRemoveMerge;
 
     itr = aMark.begin();
-    for (; itr != itrEnd && nTabCount; ++itr)
+    for (; itr != itrEnd && *itr < nTabCount; ++itr)
     {
         i = *itr;
         if( rDoc.HasAttrib( nMergeTestStartCol, nMergeTestStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i, HasAttrFlags::Merged | HasAttrFlags::Overlapped ) )
@@ -4730,7 +4730,7 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
         pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO ));
         pUndoDoc->InitUndo( &rDoc, nDestStartTab, nDestStartTab );
         ScMarkData::iterator itr = aMark.begin(), itrEnd = aMark.end();
-        for (; itr != itrEnd && nTabCount; ++itr)
+        for (; itr != itrEnd && *itr < nTabCount; ++itr)
             if (*itr != nDestStartTab)
                 pUndoDoc->AddUndoTab( *itr, *itr );
 
commit 0bb77f2161e8bcaf42c536a859c2095a3f03428a
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Mon Jan 14 10:27:40 2019 +0300
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jan 14 16:39:53 2019 +0100

    Add fileName to GDIMetaFile::dumpAsXml()
    
    GDIMetaFile::dumpAsXml() is very useful while investigating/examining
    the meta files, but it overwrites with the same file name each time.
    To be able to get different dumps at the same time, let's add
    a fileName parameter to it.
    
    Change-Id: I993720b460f326cd65519556cf1e902591d90d42
    Reviewed-on: https://gerrit.libreoffice.org/66283
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 59d4f0939076..9b43cd2f6ef8 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;
+    void dumpAsXml( const OUString& sFileName = OUString() ) const;
 };
 
 #endif // INCLUDED_VCL_GDIMTF_HXX
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index db292eebb298..7038fb7c5244 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2835,9 +2835,9 @@ void GDIMetaFile::UseCanvas( bool _bUseCanvas )
     m_bUseCanvas = _bUseCanvas;
 }
 
-void GDIMetaFile::dumpAsXml() const
+void GDIMetaFile::dumpAsXml( const OUString& sFileName ) const
 {
-    SvFileStream aStream("metafile.xml", StreamMode::STD_READWRITE | StreamMode::TRUNC);
+    SvFileStream aStream(sFileName.isEmpty() ? "metafile.xml" : sFileName, StreamMode::STD_READWRITE | StreamMode::TRUNC);
     MetafileXmlDump aDumper;
     aDumper.dump(*this, aStream);
 }


More information about the Libreoffice-commits mailing list