Skip to content

Instantly share code, notes, and snippets.

@sroycode
Created February 2, 2022 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sroycode/f0812c137496085ab3581d81c9606030 to your computer and use it in GitHub Desktop.
Save sroycode/f0812c137496085ab3581d81c9606030 to your computer and use it in GitHub Desktop.
Aspose::Slides::IFontData::get_FontName() Throws NullReferenceException
#include <cmath>
#include <memory>
#include <glog/logging.h>
#include <boost/filesystem.hpp>
#include <DOM/NullableBool.h>
#include <DOM/DocumentProperties.h>
#include <system/io/directory.h>
#include <Util/License.h>
#include <system/console.h>
#include <system/exception.h>
#include <Export/SaveFormat.h>
#include <DOM/Presentation.h>
#include <system/string.h>
#include <drawing/imaging/image_format.h>
#include <drawing/point.h>
#include <drawing/point_f.h>
#include <drawing/color.h>
#include <DOM/ISection.h>
#include <DOM/ISectionCollection.h>
#include <DOM/ISectionSlideCollection.h>
#include <DOM/ISlide.h>
#include <DOM/ISlideCollection.h>
#include <DOM/ILayoutSlide.h>
#include <DOM/IGlobalLayoutSlideCollection.h>
#include <DOM/ILayoutSlideCollection.h>
#include <DOM/IMasterLayoutSlideCollection.h>
#include <DOM/IMasterSlide.h>
#include <DOM/IMasterSlideCollection.h>
#include <DOM/IDocumentProperties.h>
#include <DOM/IProtectionManager.h>
#include <DOM/ITextStyle.h>
#include <DOM/ITextStyleEffectiveData.h>
#include <DOM/IParagraphFormat.h>
#include <DOM/IParagraphFormatEffectiveData.h>
#include <DOM/IBulletFormat.h>
#include <DOM/IBulletFormatEffectiveData.h>
#include <DOM/IFontData.h>
#include <DOM/IColorFormat.h>
#include <DOM/ISlidesPicture.h>
#include <DOM/IPPImage.h>
#include <DOM/IPortionFormat.h>
#include <DOM/IComment.h>
#include <DOM/ICommentAuthor.h>
#include <iostream>
#include <exception>
using namespace Aspose::Slides;
using SaveFormat = Aspose::Slides::Export::SaveFormat;
int main ()
{
try {
System::SharedPtr<Aspose::Slides::License> lic = System::MakeObject<Aspose::Slides::License>();
lic->SetLicense(System::String("Aspose.Slides.C++.lic"));
System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>();
System::SharedPtr<IMasterSlideCollection> cols = pres->get_Masters();
for (auto i=0; i< cols->get_Count(); ++i) {
System::SharedPtr<IMasterSlide> s = cols->idx_get(i);
System::SharedPtr<IFontData> ifont = s->get_TitleStyle()->get_DefaultParagraphFormat()->get_Bullet()->get_Font();
std::cerr << "Got Font" << std::endl;
System::String p1 = ifont->get_FontName();
}
}
catch(std::exception& e) {
std::cerr << "Error " << e.what() << std::endl;
}
catch(...) {
std::cerr << "Unknown Error " << std::endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment