Пример #1
0
		void Control::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter)  const
		{
			if (spid.IsInit() == false) return;

			std::wstring s = *spid;
			if (s.length() < 8) s = _T("_x0000_s") + s; 

			smart_ptr<OOX::IFileContainer> rels;
			std::wstring xml = GetVmlXmlBySpid(s, rels);

			if (xml.length() > 0)
			{
				std::wstring temp = _T("<v:object>");
                temp += xml;
                temp += L"</v:object>";
				
				NSBinPptxRW::CDrawingConverter oDrawingConverter;
				//oDrawingConverter.SetFontManager(pFontManager);

				RELEASEOBJECT(oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager);
				oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager = pWriter->m_pCommon->m_pMediaManager;
	
				std::wstring *main_props = NULL;

				oDrawingConverter.SetRels(rels);

				HRESULT hRes = oDrawingConverter.AddObject(temp, &main_props);
				if (hRes == S_OK && oDrawingConverter.m_pBinaryWriter->GetPosition() > 10)
				{
					pWriter->WriteBYTEArray(oDrawingConverter.m_pBinaryWriter->GetBuffer(),oDrawingConverter.m_pBinaryWriter->GetPosition());
				}
				oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager =  NULL;
			}
		}
Пример #2
0
		void Control::AddObjectTo (const std::vector<SpTreeElem> *spTreeElements, NSShapeImageGen::CMediaManager* pMediaManager) const
		{//проблема переноса картинок !!!
			if (spid.IsInit() == false) return;

			std::wstring s = *spid;
			if (s.length() < 8) s = _T("_x0000_s") + s; 

			smart_ptr<OOX::IFileContainer> rels;
			std::wstring xml = GetVmlXmlBySpid(s, rels);

			if (xml.length() > 0)
			{
				std::wstring temp = _T("<v:object>");
                temp += xml;
                temp += L"</v:object>";
				
				NSBinPptxRW::CDrawingConverter oDrawingConverter;
				oDrawingConverter.SetAdditionalParam(_T("parent_spTree"), (BYTE*)spTreeElements, 0);
	
				RELEASEOBJECT(oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager);

				oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager = pMediaManager;

				oDrawingConverter.SetRels(rels);

				std::wstring *main_props = NULL;
				HRESULT hRes = oDrawingConverter.AddObject(temp, &main_props);

				oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager =  NULL;
			}
		}