diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-19 09:04:31 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-19 09:05:09 +0100 |
commit | 93bb2101197c1ff64a5cc3ab9ffa64f66c0d9641 (patch) | |
tree | 514b272817f63b848a8cb74d19de8dc7e3450995 | |
parent | 9c928971167b6fc553f105b8141e214e6d06785f (diff) |
Let MetafileXmlDump::dumpAndParse() take a const GDIMetaFile
So the const_cast<> in CppunitTest_sw_uiwriter can go away.
Change-Id: Id7d4234154cd6bed43cb5270b50208061038dcf7
-rw-r--r-- | include/test/mtfxmldump.hxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 2 | ||||
-rw-r--r-- | test/source/mtfxmldump.cxx | 7 |
3 files changed, 7 insertions, 6 deletions
diff --git a/include/test/mtfxmldump.hxx b/include/test/mtfxmldump.hxx index 997d023412b8..5c21765574f9 100644 --- a/include/test/mtfxmldump.hxx +++ b/include/test/mtfxmldump.hxx @@ -23,7 +23,7 @@ class OOO_DLLPUBLIC_TEST MetafileXmlDump { std::vector<bool> maFilter; - void writeXml(GDIMetaFile& rMetaFile, XmlWriter& rWriter); + void writeXml(const GDIMetaFile& rMetaFile, XmlWriter& rWriter); public: MetafileXmlDump(); @@ -39,7 +39,7 @@ public: pTempStreamName - this is useful when creating the test, to dump the file for examination. */ - xmlDocPtr dumpAndParse(GDIMetaFile& rMetaFile, const OUString& rTempStreamName = OUString()); + xmlDocPtr dumpAndParse(const GDIMetaFile& rMetaFile, const OUString& rTempStreamName = OUString()); }; #endif diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 8073a4317b6f..0813dec72c80 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -789,7 +789,7 @@ void SwUiWriterTest::testFdo87448() ReadGraphic(aStream, aGraphic); const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile(); MetafileXmlDump dumper; - xmlDocPtr pXmlDoc = dumper.dumpAndParse(const_cast<GDIMetaFile&>(rMetaFile)); + xmlDocPtr pXmlDoc = dumper.dumpAndParse(rMetaFile); // The first polyline in the document has a number of points to draw arcs, // the last one jumps back to the start, so we call "end" the last but one. diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx index 43098d0d5ca7..ee896581e48f 100644 --- a/test/source/mtfxmldump.cxx +++ b/test/source/mtfxmldump.cxx @@ -231,7 +231,7 @@ void MetafileXmlDump::filterAllActionTypes() maFilter.assign(constMaxActionType, true); } -xmlDocPtr MetafileXmlDump::dumpAndParse(GDIMetaFile& rMetaFile, const OUString& rTempStreamName) +xmlDocPtr MetafileXmlDump::dumpAndParse(const GDIMetaFile& rMetaFile, const OUString& rTempStreamName) { boost::scoped_ptr<SvStream> pStream; @@ -256,10 +256,11 @@ xmlDocPtr MetafileXmlDump::dumpAndParse(GDIMetaFile& rMetaFile, const OUString& return pDoc; } -void MetafileXmlDump::writeXml(GDIMetaFile& rMetaFile, XmlWriter& rWriter) +void MetafileXmlDump::writeXml(const GDIMetaFile& rMetaFile, XmlWriter& rWriter) { - for(MetaAction* pAction = rMetaFile.FirstAction(); pAction != NULL; pAction = rMetaFile.NextAction()) + for(size_t nAction = 0; nAction < rMetaFile.GetActionSize(); ++nAction) { + MetaAction* pAction = rMetaFile.GetAction(nAction); const sal_uInt16 nActionType = pAction->GetType(); if (maFilter[nActionType]) continue; |