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 ...@@ -23,7 +23,7 @@ class OOO_DLLPUBLIC_TEST MetafileXmlDump
{ {
std::vector<bool> maFilter; std::vector<bool> maFilter;
void writeXml(GDIMetaFile& rMetaFile, XmlWriter& rWriter); void writeXml(const GDIMetaFile& rMetaFile, XmlWriter& rWriter);
public: public:
MetafileXmlDump(); MetafileXmlDump();
...@@ -39,7 +39,7 @@ public: ...@@ -39,7 +39,7 @@ public:
pTempStreamName - this is useful when creating the test, to dump the pTempStreamName - this is useful when creating the test, to dump the
file for examination. file for examination.
*/ */
xmlDocPtr dumpAndParse(GDIMetaFile& rMetaFile, const OUString& rTempStreamName = OUString()); xmlDocPtr dumpAndParse(const GDIMetaFile& rMetaFile, const OUString& rTempStreamName = OUString());
}; };
#endif #endif
......
...@@ -789,7 +789,7 @@ void SwUiWriterTest::testFdo87448() ...@@ -789,7 +789,7 @@ void SwUiWriterTest::testFdo87448()
ReadGraphic(aStream, aGraphic); ReadGraphic(aStream, aGraphic);
const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile(); const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile();
MetafileXmlDump dumper; 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 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. // the last one jumps back to the start, so we call "end" the last but one.
......
...@@ -231,7 +231,7 @@ void MetafileXmlDump::filterAllActionTypes() ...@@ -231,7 +231,7 @@ void MetafileXmlDump::filterAllActionTypes()
maFilter.assign(constMaxActionType, true); 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; boost::scoped_ptr<SvStream> pStream;
...@@ -256,10 +256,11 @@ xmlDocPtr MetafileXmlDump::dumpAndParse(GDIMetaFile& rMetaFile, const OUString& ...@@ -256,10 +256,11 @@ xmlDocPtr MetafileXmlDump::dumpAndParse(GDIMetaFile& rMetaFile, const OUString&
return pDoc; 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(); const sal_uInt16 nActionType = pAction->GetType();
if (maFilter[nActionType]) if (maFilter[nActionType])
continue; 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