trichview.com

trichview.support




Re: How to check whether RichView is empty?


Return to index


Author

Message

Sergey Tkachenko

Posted: 12/03/2002 12:05:35


There are 2 problems in your version:

- ItemCount can be == 0, and accessing the 0th item will cause exception;

- if ItemCount>1 - document is not empty, but your function can return true

if the the first line is empty.


So I suggest to convert my code to builder literally.


> Here is my version.

>

> bool _stdcall IsRVEmpty(TCustomRichView *p_RView)

> {

>   assert(p_RView);

>   return p_RView->GetItemStyle(0) >= 0 ? p_RView->GetItemText(0).IsEmpty()

:

> false;

> }

>

>





Powered by ABC Amber Outlook Express Converter