We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose::Slides::IFontData::get_FontName() Throws NullReferenceException

In the aspose C++ api,
s->get_Bullet()->get_Font()->get_FontName()
throws a System::NullReferenceException rather than return a blank string if no font is set in the pptx.

@shreos.prezentium.com,
Thank you for contacting support.

Please check your results using the latest version of Aspose.Slides for C++ if it is possible. If the issue persists, please share/specify the following:

  • input presentation file
  • comprehensive code example
  • OS version on which the code was run
  • Aspose.Slides version you used

You will please find the code in this gist
Using Aspose 22.1 on Ubuntu 18 , Clang 6

https://gist.github.com/sroycode/f0812c137496085ab3581d81c9606030

@shreos.prezentium.com,
Thank you for the additional data.
Fonts and other formatting properties may not be set for some elements of a PowerPoint document. In this case, the properties are inherited from parent elements. So you should use effective values to get actual properties. In your code example, line 68 should be like this:

System::SharedPtr<IFontData> ifont = s->get_TitleStyle()->GetEffective()->get_DefaultParagraphFormat()->get_Bullet()->get_Font();

Documents: Shape Effective Properties
API Reference: GetEffective Method

Hi:
Thank you for the mail. I am doing that as well, this is just to check if it has been set at that particular level.
I have no problem in getting blank , it is the throwing that is creating some inconvenience.

Regards
Shreos

@shreos.prezentium.com,
If any issue remains, please describe them in more detail.