Kaydet (Commit) 93bb2101 authored tarafından Miklos Vajna's avatar Miklos Vajna

Let MetafileXmlDump::dumpAndParse() take a const GDIMetaFile

So the const_cast<> in CppunitTest_sw_uiwriter can go away.

Change-Id: Id7d4234154cd6bed43cb5270b50208061038dcf7
üst 9c928971
......@@ -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
......
......@@ -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.
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment